It was only a few days ago that the Marlins were tailspinning, riding a bumpy nine-game losing streak, while the New York Mets were whipping up on the New York Yankees — you know, the Bronx Bombers — for a four-game sweep.

The Marlins could do no right.

The Mets could do no wrong.

So much for that. With a come-from-behind, 11-6 win on Sunday, the Marlins brought the Mets back down to earth in capping their first series sweep of the season.

Yes, you read that right.

The Marlins, worst team in the majors, defeated the Mets for the third consecutive day and did so in a surprising manner, blowing an early 4-1 lead, recovering from a 6-4 deficit, and rallying for their most satisfying win of the season.

“I knew that this day was going to come,” manager Mike Redmond said.

Given how poorly the Marlins had played the first third of the season, drawing comparisons to baseball’s all-time worst teams, perhaps Redmond was just more optimistic than most.

But Sunday’s where-did-that-come-from performance gave him plenty of reason to smile.

Chris Coghlan continued his resurgence with a four-hit game. Ed Lucas, the 31-year-old rookie who spent the past 10 seasons in the minors, also came through with four hits. Marcell Ozuna drove in four runs by scorching a pair of line drives over outfielders’ heads.

Heck, the Marlins even connected on a home run in their home ballpark for the first time since May 16 when Greg Dobbs put the game away in the eighth with a three-run blast.