Jeff Curry-USA TODAY Sports

Avisail Garcia hit a two-out, two-run homer in the ninth inning to rally the visiting Miami Marlins past the St. Louis Cardinals 4-3 Wednesday to avoid a three-game sweep.

Marlins starting pitcher Sandy Alcantara (8-3) threw a complete game while allowing three runs, two earned, on seven hits. He struck out three while walking two, throwing a season-high 117 pitches in his fourth career complete game.

Cardinals starting pitcher Andre Pallante held the Marlins to two runs on five hits and a walk over seven innings, striking out two. Giovanny Gallegos retired Miami in order in the eighth inning, but Ryan Helsley (3-1) allowed Garcia's blast in the ninth.

The Cardinals took a 1-0 lead with an unearned run in the bottom of the third inning. Edmundo Sosa hit a leadoff single, stole second base, moved to third base when Brendan Donovan reached on an error and scored on Dylan Carlson's sacrifice fly.

The Marlins tied the game 1-1 in the fourth. Garrett Cooper opened with a single, advanced on a groundout and scored on Jesus Aguilar's single.

Miami edged ahead 2-1 in the fifth -- but missed a chance to score more. Brian Anderson walked and Miguel Rojas and Jacob Stalllings hit singles to load the bases with nobody out.

Pallante minimized the damage. First he got Bryan De La Cruz to ground into a run-scoring double play, then he coaxed an inning-ending grounder from Jon Berti.

The Cardinals regained the lead 3-2 in the bottom of the inning. Sosa hit a one-out triple. Andrew Knizner walked, Donovan hit a sacrifice fly and Carlson smacked an RBI single.

Cooper drew a leadoff walk in the ninth for the Marlins, setting the stage for Garcia's winning homer over the center-field wall.

Lars Nootbaar drew a one-out walk in the bottom of the ninth and Conner Capel followed with a single, his first big-league hit. Marlins manager Don Mattingly visited the mound, but he left Alcantara to get Sosa to hit into the game-ending double play.

More must-reads:

TODAY'S BEST
Celtics finally put away undermanned Cavaliers, advance to conference finals
Avalanche force Game 6 with big third period vs. Stars
MLB announces punishment for Astros' Ronel Blanco over foreign substance
Vikings HC shares big Justin Jefferson contract update
Rafael Nadal switches gears, gives major update on French Open status
DeMar DeRozan confirms desire to return to Bulls
Mavericks defense rises to occasion in Game 5 win vs. Thunder
Steelers to make history in final two months of 2024 season
Packers will play on Thanksgiving with a rare twist in 2024
Steelers veteran reportedly plans to sit out OTAs
Padres pitcher has honest reaction to team getting booed off the field
Athletics place lefty on 15-day IL, transfer infielder to 60-day
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