Updated

Matt Holliday hit a solo homer and Lance Lynn spun seven strong innings as the St. Louis Cardinals edged the Miami Marlins, 3-2, to complete a three-game sweep at Busch Stadium.

Lynn (11-3) gave up two runs on seven hits while striking out seven to earn his first win since June 20.

"We've had some heartbreaks as of late," Lynn said. "To be able to get a sweep any time of the year is great. It would be nice to get hot right before the All-Star break and rattle off a bunch of wins."

Allen Craig added an RBI and Carlos Beltran had two hits and stole home for the Cardinals, winners in four of their last five games. Edward Mujica worked a perfect ninth inning to notch his 23rd save of the season.

Adeiny Hechavarria and Jeff Mathis drove in one run apiece for the Marlins, who have dropped four of their last six games.

Jose Fernandez (5-5) allowed three runs on four hits and four walks while fanning five over six innings to absorb the loss.

"They were just better than us," Fernandez said. "I thought I made some good pitches but it's not a secret for anybody, the Cardinals are one of the best teams in the league."

Holliday homered in the first inning to give the Cardinals an early lead.

The Marlins tied the game in the second. Derek Dietrich doubled, then scored on Hechavarria's base hit to right field.

St. Louis added a pair of runs in the third, with Craig scoring Matt Carpenter with a sacrifice fly to right field to put the Cardinals ahead.

Beltran moved to third on the sacrifice fly to put runners on the corners for David Freese, who ended up striking out. Holliday, though, broke for second on the play and quickly retreated back to first, giving Beltran an opportunity to steal home. As Beltran broke for the plate, Miami first baseman Logan Morrison fired the ball home. His throw was off target and Beltran slid by safely to make it 3-1.

Mathis singled home Marcell Ozuna in the fourth to pull the Marlins within 3-2.

The Marlins put runners on the corners with one out in the eighth. Cardinals reliever Trevor Rosenthal struck out Ozuna, but hit Dietrich with a pitch to load the bases. Rosenthal, though, got pinch-hitter Greg Dobbs to ground out to end the threat.

Game Notes

Lynn has won 11 games before the All-Star break in each of the last two seasons and is tied with Tigers starter Max Scherzer for most wins in the majors since 2012 with 29 ... Lynn has won 10 straight decisions at Busch Stadium and improved to 7-0 there this season ... Craig extended his hitting streak to eight games ... Hechavarria extended his hitting streak to seven games ... The Marlins fell to an NL-worst 32-55.