Jorge Alfaro hit a game-ending, two-run double, and the Miami Marlins rallied from two-run deficits in the ninth and 10th innings to beat the San Francisco Giants 7-6 Saturday night.

San Francisco led 5-3 before RBI singles in the ninth by Alfaro and Starling Marte off Jake McGee. The closer threw 35 pitches in the inning, retiring Adam Duvall on an inning-ending flyout that stranded the bases loaded.

More Images
Miami Marlins' Jazz Chisholm Jr. (2) crosses home plate on a double by Jorge Alfaro for the winning run in the 10th inning against the San Francisco Giants in a baseball game Saturday, April 17, 2021, in Miami. The Marlins won 7-6. (AP PhotoMarta Lavandier)

Jorge Alfaro hit a game-ending, two-run double, and the Miami Marlins rallied from two-run deficits in the ninth and 10th innings to beat the San Francisco Giants 7-6 Saturday night.

Miami Marlins' Jorge Alfaro, center, is congratulated after he hit a double in the 10th inning to drive in the winning run in the team's baseball game against the San Francisco Giants, Saturday, April 17, 2021, in Miami. The Marlins won 7-6. (AP PhotoMarta Lavandier)

Jazz Chisholm walked against Jarlin García (0-1) with one out in the bottom half, joining the the pandemic-rules automatic runner to give Miami two on. Chad Wallach flied out, and Alfaro lined a double that bounced to the left-field wall.

Miami Marlins' Jorge Alfaro, center, is congratulated after he hit a double to drive in the winning run in the 10th inning of the team's baseball game against the San Francisco Giants, Saturday, April 17, 2021, in Miami. The Marlins won 7-6. (AP PhotoMarta Lavandier)

San Francisco catcher Buster Posey was hit on the left arm by Alcantara's final pitch. Posey went to first base and scored on a three-run homer by pinch-hitter Austin Slater off Richard Bleier, which capped a five-run inning that put the Giants ahead 5-3. Posey left the game before the bottom half.

San Francisco Giants' Buster Posey reacts after being hit by a pitch from Miami Marlins' Sandy Alcantara during the seventh inning of a baseball game Saturday, April 17, 2021, in Miami. To the left is Marlins catcher Jorge Alfaro. (AP PhotoMarta Lavandier)

TRAINER’S ROOM

San Francisco Giants' Austin Slater, center, is congratulated by Buster Posey, left, and Brandon Crawford after Slater hit a three-run home run during the seventh inning of the team's baseball game against the Miami Marlins, Saturday, April 17, 2021, in Miami. (AP PhotoMarta Lavandier)

UP NEXT

Brandon Belt's run-scoring double against Yimi García (2-1) put the Giants ahead 6-5 in the 10th.

Miami Marlins' Jazz Chisholm Jr. (2) crosses home plate on a double by Jorge Alfaro for the winning run in the 10th inning against the San Francisco Giants in a baseball game Saturday, April 17, 2021, in Miami. The Marlins won 7-6. (AP PhotoMarta Lavandier)

Miami Marlins' Jazz Chisholm Jr. (2) crosses home plate on a double by Jorge Alfaro for the winning run in the 10th inning against the San Francisco Giants in a baseball game Saturday, April 17, 2021, in Miami. The Marlins won 7-6. (AP PhotoMarta Lavandier)

Jazz Chisholm walked against Jarlin García (0-1) with one out in the bottom half, joining the the pandemic-rules automatic runner to give Miami two on. Chad Wallach flied out, and Alfaro lined a double that bounced to the left-field wall.

Miami starter Sandy Alcantara allowed four runs and six hits in 6 1/3 innings with seven strikeouts.

Giants starter Aaron Sanchez gave up one run, five hits, three walks and a hit batter in 4 2/3 innings.

Miami Marlins' Jorge Alfaro, center, is congratulated after he hit a double in the 10th inning to drive in the winning run in the team's baseball game against the San Francisco Giants, Saturday, April 17, 2021, in Miami. The Marlins won 7-6. (AP PhotoMarta Lavandier)

Miami Marlins' Jorge Alfaro, center, is congratulated after he hit a double in the 10th inning to drive in the winning run in the team's baseball game against the San Francisco Giants, Saturday, April 17, 2021, in Miami. The Marlins won 7-6. (AP PhotoMarta Lavandier)

San Francisco catcher Buster Posey was hit on the left arm by Alcantara's final pitch. Posey went to first base and scored on a three-run homer by pinch-hitter Austin Slater off Richard Bleier, which capped a five-run inning that put the Giants ahead 5-3. Posey left the game before the bottom half.

Belt homered leading off the seventh, and Brandon Crawford had an RBI single. Belt has reached safely in 28 straight games against Miami.

Duvall tripled in a run in the first, and Jesús Aguilar made it 3-0 with a two-run double off Matt Wisler in the sixth.

Miami Marlins' Jorge Alfaro, center, is congratulated after he hit a double to drive in the winning run in the 10th inning of the team's baseball game against the San Francisco Giants, Saturday, April 17, 2021, in Miami. The Marlins won 7-6. (AP PhotoMarta Lavandier)

Miami Marlins' Jorge Alfaro, center, is congratulated after he hit a double to drive in the winning run in the 10th inning of the team's baseball game against the San Francisco Giants, Saturday, April 17, 2021, in Miami. The Marlins won 7-6. (AP PhotoMarta Lavandier)

TRAINER’S ROOM

Giants: RHP Tyler Beede (elbow surgery) and RHP John Brebbia (elbow surgery) had throwing sessions Saturday in Sacramento, California.

Marlins: RHP Edward Cabrera (right biceps inflammation) is throwing from 75 feet and is making progress.

San Francisco Giants' Buster Posey reacts after being hit by a pitch from Miami Marlins' Sandy Alcantara during the seventh inning of a baseball game Saturday, April 17, 2021, in Miami. To the left is Marlins catcher Jorge Alfaro. (AP PhotoMarta Lavandier)

San Francisco Giants' Buster Posey reacts after being hit by a pitch from Miami Marlins' Sandy Alcantara during the seventh inning of a baseball game Saturday, April 17, 2021, in Miami. To the left is Marlins catcher Jorge Alfaro. (AP PhotoMarta Lavandier)

UP NEXT

Giants LHP Alex Wood (season debut) is to start the series finale on Sunday while the Marlins go with RHP Pablo Lopez (0-1, 4.60).

More AP MLB: https://apnews.com/MLB and https://twitter.com/AP_Sports

San Francisco Giants' Austin Slater, center, is congratulated by Buster Posey, left, and Brandon Crawford after Slater hit a three-run home run during the seventh inning of the team's baseball game against the Miami Marlins, Saturday, April 17, 2021, in Miami. (AP PhotoMarta Lavandier)

San Francisco Giants' Austin Slater, center, is congratulated by Buster Posey, left, and Brandon Crawford after Slater hit a three-run home run during the seventh inning of the team's baseball game against the Miami Marlins, Saturday, April 17, 2021, in Miami. (AP PhotoMarta Lavandier)