Rich Storry-USA TODAY Sports

Jesus Sanchez hit a bloop, opposite-field, walk-off single in the 12th inning as the Miami Marlins rallied multiple times to defeat the visiting Philadelphia Phillies 9-8 on Wednesday night.

The Marlins rallied from a 5-0 deficit in the sixth, then tied the score in the ninth, 10th and 11th innings before winning it in the 12th. A total of seven runs were scored after the ninth inning.

Phillies heroes included Alec Bohm, who went 4-for-6 with three RBIs (including the go-ahead, run-scoring single in the 11th), and Brandon Marsh, who slugged a two-run homer in the top of the 10th.

One of Miami's biggest hits was by Jorge Soler, who tied the score 5-5 in the bottom of the ninth with his 404-foot solo homer to center. It was his 26th dinger of the year.

But Marlins closer David Robertson -- acquired from the New York Mets last week -- got roughed up for the second straight night in allowing Marsh's dinger.

Miami was also led by first baseman Josh Bell and center fielder Jazz Chisholm Jr., who homered on consecutive pitches in the sixth inning. Bell (4-for-5 with one walk and two RBIs) and third baseman Jake Burger (2-for-4 with one walk) made their Marlins debuts after arriving via deadline trades on Tuesday.

Jon Berti tied the score in the 10th with a sacrifice fly and Bell's RBI single knotted things in the 11th.

Marlins second baseman Luis Arraez, who leads the majors with a .378 batting average, went 1-for-6. He also survived an eighth-inning play in which he appeared to get spiked by Philadelphia's Garrett Stubbs.

The Phillies opened the scoring in the fourth as they started the inning with four straight hits, including RBI singles by Nick Castellanos and Bryson Stott.

Philadelphia scored three more runs in the sixth, getting just one hit but taking advantage of four walks and one hit batter against three pitchers. The third pitcher, Steven Okert, nearly got out of the jam cleanly, striking out Johan Rojas and getting Kyle Schwarber on an infield pop.

Bohm then took a 1-2 slider that might have ended the inning had it been a couple of inches higher. On the next pitch, Okert left a slider up and Bohm lined a two-run double to left for the only hit of the inning and a 5-0 lead.

Miami got back in the game in the sixth as Bell's homer went 383 feet and Chisholm one-upped him with a 424-foot drive.

Miami loaded the bases with one out in the eighth as Bell singled and Avisail Garcia and Burger walked with one out. Sanchez followed with an RBI walk and Berti added a run-scoring groundout to cut Miami's deficit to 5-4.

Soler's homer tied the score 5-5 in the ninth, and Marsh's dinger gave the Phillies a 7-5 advantage.

Garcia had an RBI groundout to make it 7-6, and Berti's sacrifice fly tied the score.

More must-reads:

TODAY'S BEST
Kristaps Porzingis is difference-maker for Celtics in NBA Finals
Lakers brass set to meet with priority head-coaching candidate
Iga Swiatek's clay court dominance puts her a win away from French Open elite
Chiefs DE BJ Thompson in stable condition after medical emergency
Adam Silver: 'Societal issues' can't be ignored regarding Caitlin Clark's WNBA treatment
Watch: Oklahoma softball beats Texas to four-peat as national champion
Josh Jacobs opens up about Raiders departure
Yankees star pulled from Thursday's game over injury concern
Alabama hoops set to get a multimillion-dollar upgrade
Padres starter, former All-Star diagnosed with bone spur in elbow
Celtics begin NBA Finals with heart-warming tribute to late Bill Walton
USA cricket pulls off historic upset win against Pakistan in T20 World Cup
Utah NHL team has list of names narrowed down to six
Watch: Dallas Mavericks drop hype video narrated by Patrick Mahomes
Bears QB Caleb Williams has high expectations for 2024 season
Patrick Beverley defends Celtics' path to NBA Finals
Broncos' best receiver makes call on minicamp attendance
Justin Fields excited to team up with Steelers' 'freak athlete'
Mavericks X-factor makes statement on free agency ahead of NBA Finals
Insiders: Networks will court Charles Barkley if TNT loses NBA rights