Rotherham's impressive first-half showing almost counted for nothing as they were left hanging on to claim a vital three points with a 3-2 win over Wigan in a match between the Sky Bet Championship's bottom two teams.
The Millers, who have endured a horror first half to the season, blitzed their nearest rivals in the opening 45 minutes as goals from Aimen Belaid, Danny Ward and a Dan Burn own goal gave them a comfortable 3-0 half-time lead.
But the second half was a different story and Wigan, booed off at half-time, launched a stirring comeback, scoring through Yanic Wildschut and Jordi Gomez.
Paul Warne's men just had enough to hold on, though, to claim only a third win of the campaign, as they cut the gap to 10 points and can begin to dream of a survival fight in the second half of the season.
Wigan are certain to be in that fight as they lost for a fifth successive game and boss Warren Joyce will be wondering why his side could not have performed like they did in the second half for the entire 90 minutes.
Given the severity of their deficit at the bottom of the league, Rotherham had little option but to win this game and they started accordingly, putting the Latics under early pressure and it was rewarded with an eighth-minute lead.
A corner fell to Lee Frecklington and his miscued effort, which went back across goal, was diverted by Belaid, who instinctively thrashed home his first goal for the club.
The Millers' play deserved another goal and when it eventually came in the 32nd minute there was a large amount of luck about it.
Joe Mattock's mis-hit shot was diverted to Ward and his effort, that Wigan goalkeeper Jussi Jaaskelainen looked to have lined-up, was cruelly deflected off Millers defender Richard Wood, leaving the Iceland custodian wrong-footed.
It was officially awarded to Ward, though Wood may be hoping the dubious goals panel investigates.
The woodwork denied them another as Tom Adeyemi lashed a 25-yard effort that rattled the crossbar, but there was no stopping the rampant Millers and they were allowed to enjoy the sweetest of half-time intervals as they went 3-0 ahead in first-half injury time.
After Ward was played in his fierce drive was saved by the luckless Jaaskelainen but the rebound crashed into Burn and went in.
Wigan were booed off by their angry fans at half-time, but they made a good job of appeasing them as Wildschut gave them hope just six minutes after the restart as he expertly curled in from the edge of the area.
That goal changed the complexion of the game completely as Wigan enjoyed complete domination in terms of possession and territory, but they had to wait until the 79th minute to make further inroads into their deficit.
Andy Kellett made good progress down the right and he squared to Gomez who drilled into the bottom corner from the edge of the area.
That set up a grandstand finish as Wigan threw everything at their hosts.
They thought they had found a leveller when they rammed home a ball from close range but Will Grigg was penalised for a deliberate handball and it was Rotherham's day.