SAN FRANCISCO -- Pinch-hitter Wil Nieves hit a one-out sacrifice fly to score Paul Goldschmidt in the top of the 10th inning as the Arizona Diamondbacks beat the San Francisco Giants in extra innings for the second consecutive day, this time 3-2.
The one-run thriller capped a roller-coaster of a series in which the Diamondbacks held late-game leads in all three games, only to see the Giants rally in the eighth or ninth inning either to win or force extra innings.
Despite three blown saves by three different pitchers in three days, Arizona won for the seventh consecutive time this season on getaway day and earned a series win after getting caught and passed in a 5-4 loss in the final two innings of the series opener Monday.
In the rubber game of the series, the Diamondbacks had to bounce back from Brandon Crawford's game-tying home run off David Hernandez (1-1) in the ninth inning, but they did just that after Goldschmidt worked losing pitcher Chad Gaudin (0-1) for a one-out walk in the 10th.
Cody Ross advanced Goldschmidt to third with a double into the right-field corner, prompting the Giants to intentionally walk Miguel Montero to load the bases.
Nieves, pinch-hitting for Eric Chavez, then greeted left-hander Javier Lopez with a fly ball to medium-deep center field, producing the difference-making.
Matt Reynolds recorded his second save in two days despite allowing a heart-stopping double to Brandon Belt that short-hopped the center-field fence. Belt was stranded on second, however, when pinch-hitterr Joaquin Arias grounded out to shortstop.
Batting for the first time after misreading a pop fly that helped produce Arizona's go-ahead run in the top of the ninth, the Giants' Crawford tied the score at 2-2 with his fourth home run of the season, a one-out shot to right field off Hernandez, who also surrendered a game-tying homer Monday night.
After 6 1/2 scoreless innings, both teams scored once in its next at-bat, ending shutout bids by starters Ian Kennedy and Madison Bumgarner.
The pitchers' duel came as no surprise given the matchup. Kennedy entered the game having lost just once in seven career starts at pitcher-friendly AT&T Park, compiling a 2.66 ERA over that stretch. Bumgarner, meanwhile, brought one of the National League's best records (3-0) and ERA's (2.05) into the contest.
The Giants finally got to Kennedy for a run in the bottom of the seventh after Gregor Blanco opened the inning by grounding a single to right. Crawford then smacked his second consecutive hit off the Diamondbacks' ace right-hander, ending his day with a liner that rolled to the fence in center field for a double, scoring the speedy Blanco without a throw.
Brad Ziegler relieved Kennedy at that point and minimized the damage by stranding Crawford at third base.
Three batters later, the game was tied again and it was Bumgarner who was headed for the showers. A.J. Pollock ended the left-hander's day with a one-out single up the middle of the diamond, scoring pinch-runner Parra from second base.
Parra was running for Eric Hinske, who had just been involved in an unusual play destined for the blooper reels. Pinch-hitting for Ziegler, the left-handed swinger sliced a drive that appeared headed for the left-field corner until it was fielded on a hop by Santiago Casilla, who was warming up in the Giants' bullpen.
Hinske was awarded second base on the hit and Casilla, following Pollock's game-tying hit, was brought into the game, eventually retiring Ross with two on and two out to send the game to the bottom of the eighth tied at 1.
The Giants didn't have a hit against Kennedy until Crawford led off the fifth inning with a two-strike liner into center field. But a failed sacrifice bunt attempt by Bumgarner, forcing Crawford at second, helped keep the game scoreless.
The Giants' next hit -- a leadoff double to left field by Scutaro in the sixth -- produced a much greater threat. But Kennedy got .300-hitting Pablo Sandoval to pop out to shortstop on a full count, then struck out Hunter Pence and Belt to continue the run of zeroes.
NOTES: The Diamondbacks finished their nine-game, three-city trip 4-5. ... Fifteen of Arizona's first 21 games have been decided by two or fewer runs. ... The Giants completed their six-game homestand 4-2 after winning the first four games. ... It was no surprise the Diamondbacks and Giants split the first two games of the series. They went 9-9 against one another in each of the last two seasons. ... Both teams will be involved in rematches of games played last Saturday in their next outings. The Diamondbacks open a seven-game homestand Thursday against the Rockies with Trevor Cahill looking to reverse a 4-3 loss to Colorado's Jorge De La Rosa. The Giants, meanwhile, hit the road for six games beginning Friday in San Diego, with Tim Lincecum looking to duplicate his 2-0 victory over Padres prospect Andrew Cashner. ... The Giants and Diamondbacks hook up again next Monday through Wednesday in Phoenix, with Wednesday's starters -- Bumgarner and Kennedy -- both scheduled in the series, but not against each other.