PHOENIX (AP) Tim Locastro's single with the bases loaded in the 10th inning gave the Arizona Diamondbacks a 3-2 win over the San Francisco Giants on Sunday.
Locastro's line drive to left field scored Nick Ahmed and helped the Diamondbacks end a season-long six-game losing streak.
Giants reliever Mark Melancon (3-2) uncorked a wild pitch to put runners at second and third with one out, and Carson Kelly was intentionally walked to bring up Locastro.
Matt Andriese (4-4) pitched a scoreless top of the 10th to earn the win. Christian Walker had three hits for Arizona.
Kevin Pillar homered for the Giants, his 10th of the season, but San Francisco was held to four hits for the game.
Locastro rolled a single into shallow right field, the Diamondbacks' first hit of the game, driving in Caleb Joseph with two outs in the third inning. The Giants tied the score at 1 on Stephen Vogt's ground out to score Evan Longoria from third base in the top of the fourth.
Arizona went back in front 2-1 with Walker's RBI single in the fourth, the result of a nine-pitch at-bat that drove in Adam Jones, who'd reached on a wild pitch third strike.
Pillar led off the seventh inning with a solo shot to left field, which spelled the end of Diamondbacks starter Merrill Kelly's day. Kelly went six innings and allowed two runs on four hits, striking out nine.
The Diamondbacks opened their half of the seventh with back-to-back hits off Giants starter Shaun Anderson to put runners on second and third, and the Giants turned to Reyes Moronta in relief. Moronta worked out of the jam without allowing a hit.
Anderson allowed two runs on five hits in six innings.