Former Manchester United player Nick Powell scored a stoppage-time winner to give Wigan a relegation lifeline after a five-goal Sky Bet Championship thriller against Rotherham.
The Millers had twice led through Danny Ward and Anthony Forde, with Gabriel Obertan and Alex Gilbey replying for Wigan.
But Powell - named on the bench after three months out with hamstring trouble - was sent on by Wigan boss Graham Barrow in the last quarter, and converted a free-kick with only seconds to go to give the home side renewed hope.
Wigan were claiming a penalty inside two minutes when Michael Jacobs took a tumble in the area, only for referee Mr Duncan to wave play on.
Rotherham were almost gifted the lead with eight minutes gone when Wigan goalkeeper Jakob Haugaard - recalled in place of Matt Gilks - saw a clearance charged down by Ward.
However, the Millers striker was unable to slot home into an empty goal from a tight angle.
Max Power might have done better with Wigan's first sight of goal, only to pull his 20-yard shot wide of the far post.
And the home side paid the price when Rotherham went ahead just before the half-hour mark.
Joe Newell had just missed a great chance when he could only fire weakly at Haugaard.
But Ward made amends for his earlier miss when he converted a clever pull-back from the right wing.
Loud boos rung around the DW Stadium from the home end, but Wigan reacted well and were level within five minutes.
The ball broke to Obertan in the area, and the ex-Manchester United man slotted home with clinical precision.
Wigan pushed forward in search of another, but they were rocked on their heels on the hour mark when Forde beat Haugaard with a good finish from the edge of the area.
It could have been game over moments later when Carlton Morris curled an effort towards the far post and Haugaard only just got there to flick it round the post.
And Wigan gave themselves hope when Obertan fed Gilbey, who controlled and finished with aplomb.
Gilbey came close to putting Wigan ahead five minutes later only for Price to pull off a fine save diving to his right.
But at the other end, Haugaard had to be alert to keep out a Ward effort with his feet.
With a draw of no use to either team, there was to be one more flashpoint in the last of the five added minutes.
Millers goalkeeper Price and Powell were involved in an off-the-ball altercation after the former launched the ball downfield, resulting in a free-kick to Wigan on the edge of the box and a yellow card for both men.
And Powell exacted the perfect revenge when he blasted home the set-piece to the delight of everyone inside the DW Stadium.