SAN DIEGO (AP) -- If Arizona's going to bounce back from its disastrous start, the Diamondbacks will need a lot more outings like the kind Brandon McCarthy turned in Saturday night.
He threw seven shutout innings before the Diamondbacks weathered a ninth-inning rally to hang on for a 4-3 win over the San Diego Padres on Saturday night.
The Diamondbacks handed San Diego its fourth straight loss as the major-leagues' worst offensive team was two outs away from its second straight shutout to Arizona before scoring three runs in the ninth.
McCarthy (1-5), who tied his career high with his fifth straight loss in his last start, gave up three hits, including two doubles to Seth Smith, and allowed just one runner to reach third base. He struck out six and walked one.
''The story of the night was McCarthy's performance,'' Arizona manager Kirk Gibson said.
''We just settled in where we were and not try too hard. We just tried to execute as many pitches that we could,'' said McCarthy. ''(It) was about the least strong I felt all season. I felt good I just didn't feel as strong as I had. It's good to know that if it's not feeling right, it's still there.''
The Diamondbacks, who came into the game with the majors' highest ERA at 5.03, had their scoreless innings string snapped at 24 innings when J.J. Putz allowed a one-out single to Smith and an RBI double to Yasmani Grandal.
Addison Reed then surrendered Jedd Gyorko's two-run homer. After getting an out, Reed gave up Cameron Maybin's double and walked pinch hitter Will Venable. Reed ended the game by getting Xavier Nady on a flyout for his eighth save in nine chances.
McCarthy turned in his second straight strong start, coming on the heels of a seven-inning, two-run outing with a career-high of 12 strikeouts.
''He's got his mechanics together,'' Gibson said. ''He's able to repeat his delivery.''
Although McCarthy looked strong through seven innings, Gibson decided to lift his right-hander, a decision to which McCarthy agreed.
''There was a little bit more in the tank,'' he said. ''The constantly covering first and base running takes it out of me because I'm scared to death out there and my heart beats like crazy. By the time I come back in I feel like I've thrown an extra inning.''
McCarthy had three putouts, including one where he fielded the ball near the first-base line and continued onto first base for an unassisted putout. He also singled in the fourth with two outs and advanced to second before the inning ended.
The Diamondbacks (11-22) have won three straight and fourth consecutive road games to raise their road record to 8-7.
The Padres scored more runs in the game then they had in their previous three games combined.
San Diego entered the game last in the majors in runs per game, on-base percentage, slugging percentage, and was tied for the worst batting average at .213.
''We just need some more timely hitting,'' said Padres catcher Yasmani Grandal. ''We've been struggling but we still have five more months in the season. You know it's not going to last the whole season.''
Said San Diego manager Bud Black: ''It's tough when you're going through it but we'll come out of it and hopefully the pitching continues to be as strong as it has been and our hitters start hitting the ball on the nose. When you're going through it, it is not easy.''
Ian Kennedy (2-4) allowed three runs on 11 hits over five innings with seven strikeouts and one walk. Kennedy is 1-1 with a 6.06 ERA in three starts against his former team.
The Diamondbacks went ahead 2-0 in the second on Miguel Montero's leadoff homer and consecutive doubles by Chris Owings and Marte.
Arizona tacked on one run in the fifth on three straights singles, including Owings' RBI hit to left, and another in the seventh on Marte's infield single.
Owings and Montero each had three hits to lead the Diamondbacks' 14-hit attack.
Notes: McCarthy had received only one run of support while on the mound in his previous four starts. ... The Padres lead the majors with 21 one-run games (11-10 record). ... Montero played his 800th game, the fourth player to reach that mark with the Diamondbacks. ... D'Backs LHP Wade Miley (2-3, 5.36 ERA) will oppose Padres righty Tyson Ross (3-3, 3.68) in Sunday's series finale.