By R.B. FALLSTROM

AP Sports Writer

ST. LOUIS (AP) — After the Ricky Nolasco trade, Jose Fernandez is the lone member of the Miami Marlins rotation who's been with the team since opening day.

Their lone All-Star pitched like it in a 3-2 loss to the St. Louis Cardinals on Sunday.

Without his best stuff, the 20-year-old right-hander kept the game close.

"He gave us everything he had," manager Mike Redmond said. "He didn't have his great command today and he was really having to grind to get through that lineup.

"He gave us a chance and that's what he's done really almost every time this year."

Fernandez (5-5) worked six innings a day after getting the All-Star nod and gave up three runs and four hits and a season-high four walks. He hadn't allowed more than two earned runs in his previous six outings.

He was disappointed only by the end result.

"My velocity was there and stuff-wise everything was consistent and nothing was loopy or anything like that," Fernandez said. "I think it was a pretty good game. They came out on top this time."

Matt Holliday homered in the first for the Cardinals, who wrapped up a three-game sweep and regained a share of the NL Central lead after the Pirates lost to the Cubs. Fernandez was victimized by Carlos Beltran's steal of home in a two-run third fueled by Beltran's bunt hit, a hit batter and a walk.

"I think they got four hits on me and it's fine," Fernandez said. "I feel great, I feel strong. Nothing to worry about. Five days, go back out there and do what I do."

Lance Lynn (11-3) worked seven strong innings in 87-degree heat and matched All-Star Adam Wainwright for the team lead in wins, bouncing back from losses in consecutive starts for the first time in his career. He struck out seven, fanning Giancarlo Stanton all three times, and has reached 11 wins prior to the break both of his years in the rotation.

The Cardinals swept the Marlins for the first time since Aug. 4-7, 2011 at Florida, and the first time at home since May 23-25, 2000.

Trevor Rosenthal escaped a bases-loaded jam in the eighth by getting pinch-hitter Greg Dobbs on a groundout, getting some help when Stanton froze between second and third and could not score on Logan Morrison's hit.

The past two losses were one-run decisions.

"We obviously can compete with them," Morrison said. "If a couple of things go our way or we make a couple of better plays, we win this game. That's why they're going to be in the playoffs. That's why we're not, because they know how do those things.

"We're young, we're learning, we'll get there."

Edward Mujica pitched for the fourth straight game and finished for his 23rd save in 24 chances, giving him a win and two saves in the series.

Adeiny Hechavarria and Jeff Mathis had an RBI apiece for the Marlins, who had won eight of 10 entering the series and had been on a 19-11 roll since May 31. Derek Dietrich doubled, walked and was hit by a pitch twice.

"We came in here after taking two out of three against Atlanta feeling great," Redmond said. "We didn't play great the first game, yesterday we had a chance and let that one slip away, and today, too.

"We're in those games, which is good news."

Holliday's 12th homer, and first in 12 games, was a 420-foot shot to straightaway center.

Both teams scored early. A wide throw to the plate from first baseman Morrison helped Beltran score on the front end of a double steal with Holliday in the third for St. Louis, and Mathis had a squeeze bunt for an RBI in the fourth for the Marlins.

Stanton struck out three times for the second time in four games. He's 1 for 7 against Lynn with a homer, two RBIs, a walk and five strikeouts.

NOTES: Wainwright (11-5, 2.36) jumps ahead of rookie Shelby Miller in the rotation to start Tuesday against the Astros and Bud Norris (6-7, 3.22). Wainwright also will start the final game before the break, but didn't mind not being eligible to pitch in the All-Star game. … Kevin Slowey (3-6, 4.24) takes Nolasco's rotation spot for the Marlins on Monday at home against the Braves and Mike Minor (8-4, 3.15). … Duck Dynasty star Willie Robertson threw the ceremonial first pitch. … Holliday grounded into his major league-leading 22nd double play in the fifth. Both teams had a pair of double-play balls in the finale and totaled 10 in the series, five by each. … All three games were sold out and offered giveaways, with a porch flag for the finale following a Holliday jersey and Mike Shannon bobble head. … The Cardinals earned their first sweep since taking four straight from Milwaukee May 2-5. The Marlins have been swept nine times, seven times in three-game series and twice in two-gamers.

(Copyright 2013 by The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)

Join our Newsletter for the latest news right to your inbox