MIAMI (AP) Jack Flaherty hoped to take control of Thursday's series finale against the Miami Marlins right away.

“I wanted to set the tone in inning one," the Cardinals right-hander said. "You just can’t coast into the game. You have to come out and do it right away.”

Flaherty pitched shutout ball for his second straight start to help the St. Louis Cardinals beat the Miami Marlins 3-0 to avoid a series sweep.

St. Louis dropped the first three games of the series. Two were one-run defeats, including a 10-9 walk-off loss Wednesday night.

Flaherty (6-5) struck out five, walked two and allowed nine hits. He also threw six scoreless innings against the New York Yankees on July 1 and has lowered his ERA from 4.95 to 4.27 in the two starts.

Chris Stratton replaced Flaherty in the seventh after Miami loaded the bases on a pair of two-out singles and a walk. Stratton got Jesús Sánchez to hit into an inning-ending forceout.

Despite Flaherty giving up the two singles to Luis Arraez and one to Jorge Soler, Cardinals manager Oliver Marmol decided to keep Flaherty in the game for one more hitter before he walked Bryan De La Cruz on his season-high 111th pitch.

“It was just a matter of making sure he had something left in the tank, one more hitter," Marmol said. “And he said he did. It was his game at that point, and I wanted to see that at bat. He wanted it, too.”

Giovanny Gallegos pitched a 1-2-3 eighth. One night after his throwing error allowed a Marlins win, Jordan Hicks got three outs for his sixth save.

Miami was 1 for 9 with runners in scoring position through the first seven innings.

Nolan Arenado’s two-out solo homer off Marlins rookie Eury Pérez in the sixth went 405 feet to right-center and put St. Louis ahead 1-0. It was Arenado’s 17th home run of the season and tied him with Nolan Gorman for the team lead.

“I feel we could have won three out of four. But that’s how baseball works,” Arenado said. “We ended up losing three out of four. That’s how the first half has gone.”

Pérez (5-3) struck out seven, walked two and gave up three hits in six innings. He was replaced by Dylan Floro after Pérez matched a season-high with 93 pitches. In his previous start on July 1, Pérez lasted just one-third of an inning against Atlanta, giving up six runs and seven hits in an eventual 7-0 loss.

“I think it was a good outing for me, bouncing back from the previous one," Pérez said. "Pitches, some of them were not landing where I wanted, but I’ve got to continue going out there.”

Arraez had his 12th three-hit game of the season and his first multi-hit game of the series. His MLB-leading average is .389.

Marlins rookie Dane Myers has a hit in each of his first three major league games, including multi-hit games on Tuesday and Wednesday.

Alec Burleson singled on a ground ball to right in the seventh, which scored Gorman and made it 2-0.

Gorman had a leadoff double in the seventh and drove in Lars Nootbaar in the eighth with a double.

Miami had 30 runs in the first three games of the series. That was after the Marlins managed seven runs in a three-game series against Atlanta.

ALL STARS

Arraez and Soler were recognized pregame for their 2023 All-Star nods. Arraez will be the NL's starting second baseman. Soler is tied for sixth in the league with 22 home runs.

ROSTER MOVE

The Cardinals optioned left-hander Matthew Liberatore to Triple-A Memphis and called up rookie right-hander Kyle Leahy from Memphis. Liberatore was lifted Wednesday night after giving up five hits, a walk and four runs against the first seven batters he faced.

TRAINER'S ROOM

Cardinals: Tommy Edman had an MRI on his right wrist Thursday but came in as a defensive replacement in the eighth. Edman was a late scratch Wednesday after experiencing pain in his wrist during pregame batting practice, though he entered in the ninth as a defensive replacement. ... First baseman Paul Goldschmidt had the day off.

Marlins: CF Jonathan Davis had surgery Thursday to repair the meniscus in his right knee. Manager Skip Schumaker said his recovery timeline is three-to-six months.

UP NEXT

Cardinals: St. Louis will play a three-game series at the Chicago White Sox before the All-Star break. LHP Jordan Montgomery (6-7, 3.28) will start Game 1.

Marlins: Miami will host Philadelphia in a three-game series before the All-Star break. RHP Sandy Alcantara (3-7, 4.93) will start Game 1.

AP MLB: https://apnews.com/hub/mlb and https://twitter.com/AP-Sports

Copyright 2024 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.