SAN FRANCISCO (AP) - Brandon Crawford hit a game-ending RBI single, and the San Francisco Giants rallied from an early 3-0 deficit to beat the Arizona Diamondbacks 4-3 on Wednesday.
Wilmer Flores tied the game in the eighth with a pinch-hit homer. Brandon Belt started the rally with a solo homer in the seventh as the Giants took two of three from the D-backs and won their first series since June 17-19 at Pittsburgh.
Ketel Marte homered for the D-backs, who have lost 17 of their last 19 games at Oracle Park.
Belt led off the ninth against Padres closer Mark Melancon (3-8) with a single. Mike Yastrzemski hit a one-out double to right, David Villar walked to load the bases, and Crawford hammered a line drive to right field off the glove of Daulton Varsho to score Belt.
Camilo Doval (3-4) struck out two in a scoreless ninth for the Giants, who have won four of five since a 4-14 stretch that dropped their record to .500.
Daulton Varsho hit a two-run triple in the second inning and Marte went deep in the third for the last-place Diamondbacks. All three runs were charged to Sam Long, who followed opener John Brebbia with 1 2/3 innings.
The Giants' bullpen was flawless from there. Tyler Rogers, Jarlin Garcia, Mauricio Llovera and Doval combined to allow two hits over the final 6 1/3 innings.
D-backs starter Zac Gallen took a shutout into the seventh before allowing Belt's one-out blast to right-center. Thairo Estrada followed with a single, Yastrzemski doubled and Villar's flyball scored Estrada to make it 3-2.
Gallen allowed two runs on four hits and struck out five in 6 2/3 innings as his winless streak reached eight starts. His last win came on May 30.
IN A PINCH
Giants manager Gabe Kapler sent four straight pinch-hitters to the plate in the eighth. Flores homered while batting for Austin Wynns. Darin Ruf then hit for LaMonte Wade Jr. and singled. Yermin Mercedes replaced Joc Pederson and struck out. Luis Gonzalez came up for Austin Slater and grounded into an inning-ending double play.
Diamondbacks: RHP J.B. Bukauskas (strained right shoulder) continued his rehab assignment with Triple-A Reno on Tuesday, allowing two hits and striking out one in a scoreless inning.
Giants: 3B Evan Longoria (left oblique strain) is expected to begin a rehab assignment as early as Thursday. There is a chance he could return before the All-Star break. "I think there's a possibility for the weekend," Kapler said.. "I think we want to make sure that door stays open."
The Giants claimed RHP Angel Rondon off waivers from the St. Louis Cardinals and optioned him to Triple-A Sacramento.
Diamondbacks: LHP Madison Bumgarner (5-8, 3.65 ERA) opens a three-game series at San Diego on Friday. The Padres have won seven of the first nine meetings this season.
Giants: LHP Carlos Rodon (8-5, 2.70) takes the mound on Thursday as San Francisco welcomes Milwaukee for a four-game series.
More AP MLB: https://apnews.com/hub/mlb and https://twitter.com/AP_Sports