Sergio Estrada-USA TODAY Sports

Brandon Crawford lined a bases-loaded single off the glove of right fielder Daulton Varsho to score Brandon Belt with the winning run in the bottom of the ninth inning Wednesday afternoon as the San Francisco Giants rallied for a 4-3, walk-off win over the visiting Arizona Diamondbacks.

Crawford ripped closer Mark Melancon's first pitch deep enough to right that Belt could have tagged and scored even had Varsho made the catch. The hit was the first of Crawford's career against Melancon (3-8), a former teammate, after having been 0-for-7.

Belt, whose home run two innings earlier ignited a rally from a 3-0 deficit, got the winning uprising going with a single. With one out, Mike Yastrzemski doubled to right, sending Belt to third, after which David Villar drew a four-pitch walk to load the bases and bring Crawford to the plate.

Giants closer Camilo Doval (3-4) was credited with the win after stranding Alek Thomas at third base in the top of the ninth to preserve the tie.

Down 3-0 after the Diamondbacks scored two in the second and one in the third, the Giants rallied with two of their own in the seventh and one in the eighth. Wilmer Flores' pinch-hit home run off Arizona All-Star Joe Mantiply leading off the eighth got the hosts even.

The homer was Flores' 13th of the season.

Belt launched his seventh, a solo shot, and Villar added a sacrifice fly three batters later to account for the Giants' first two runs off Arizona starter Zac Gallen, who had taken a one-hit shutout into the seventh.

He left after Villar's sacrifice fly, charged with two runs on four hits in 6 2/3 innings. He walked two and struck out five.

Arizona's early runs off Giants reliever Sam Long came via a two-run triple by Varsho in the second and a solo homer by Ketel Marte, his seventh of the season, in the third.

Long took over after Giants opener John Brebbia worked a scoreless first inning.

Belt, Yastrzemski and Thairo Estrada had two hits apiece for the Giants, who won the series 2-1 after dropping two of three in Arizona last week. Belt scored two of San Francisco's four runs.

Marte and Jake McCarthy had two-hit days for the Diamondbacks, who were out-hit 9-8.

More must-reads:

TODAY'S BEST
Steelers to make history in final two months of 2024 season
Steelers veteran reportedly plans to sit out OTAs
Padres pitcher has honest reaction to team getting booed off the field
MLB announces punishment for Astros' Ronel Blanco over foreign substance
Athletics place lefty on 15-day IL, transfer infielder to 60-day
Rafael Nadal switches gears, gives major update on French Open status
Atlanta to be first race of NASCAR's In-Season Tournament
West Point alum made history in his MLB debut with Reds
Heat legend cautions Lakers against hiring JJ Redick
Welcome to the WNBA: Caitlin Clark sets infamous record in debut
Jalen Brunson leads Knicks to blowout win in Game 5 vs. Pacers
Nikola Jokic torches DPOY to lead Nuggets past Wolves in Game 5
Oilers use late heroics to tie Canucks at two games each
Watch: Astros pitcher ejected after foreign substance check
Kirk Cousins not angry with Falcons because winning is 'hard enough'
Bronny James has surprising comments on potentially teaming up with LeBron
Bills add two-time Super Bowl champ to new-look WR room
Brewers lose team-leading home run hitter to injured list
Sandy Alderson denies involvement in Mets, Billy Eppler IL controversy
Twins reliever shut down for six weeks with patellar tendon tear

Want more MLB news?

Join the hundreds of thousands of fans who start their day with Yardbarker's Morning Bark, the best newsletter in sports.