ROTHERHAM United lost their unbeaten away record as they suffered derby-day despair in their South Yorkshire showdown against Doncaster Rovers at the Keepmoat Stadium.
The Millers had led at the break in the League One clash through a debut goal by Scottish winger Jake Hastie.
But they couldn't survive a second-half onslaught from the home side and an 87th-minute penalty by Ben Whiteman wrapped up the win for Doncaster after James Coppinger had earlier brought Rovers level.
Paul Warne's men can have no complaints as they were hardly in the contest in the second half.
Neither side had managed an effort on target when Rotherham took the lead in the 37th minute.
Hastie's set-piece delivery had been dangerous all half and this time his inswinging free-kick evaded everyone to nestle in the far corner of the Rovers' net.
Soon afterwards he was the provider as his cross was headed wide by Ben Wiles.
Before the goal, Michael Ihiekwe had headed Wiles' corner off target while all Rovers had to show for their efforts was a 26th-minute shot over the bar from the edge of the area by Whiteman.
Hastie was the supplier again in the 51st minute when Richard Wood climbed highest to head his corner just over, but that was virtually the last time the visitors threatened as Doncaster took control.
On the hour mark, Jon Taylor, playing against his former club, met Coppinger's pinpoint cross with his head but directed his attempt too high.
Rovers were pushing for an equaliser and it required a superb save from Lewis Price to keep out Ben Sheaf's 62-minute drive before Tom Anderson headed off target.
The leveller came in the 66th minute when James Coppinger mishit his shot but still tucked away substitute Niall Ennis's low pull-back.
Price was called into action again when Taylor stung his palms on 70 minutes and had to save from another former Miller, Reece James, four minutes later.
Yet again the Rotherham keeper came to the rescue, clawing away an Ennis shot, and Kieran Sadlier fired just wide.
The pressure finally told in the dying minutes when Ihiekwe was judged to have fouled game-changing Ennis and Whiteman stepped up to slot home the winner.
The same player could have added further to the Millers' misery but sent a fierce shot skidding past the post.
Goals: Coppinger 66, Whiteman pen 87 (Doncaster); Hastie 37 (Rotherham).
Doncaster (4-2-3-1): Ian Lawlor; Brad Halliday, Tom Anderson, Cameron John, Reece James; Ben Sheaf, Ben Whiteman; Jon Taylor (Matty Blair 80), James Coppinger, Alfie May (Kieran Sadlier 61); Kazaiah Sterling (Niall Ennis H-T). Subs not used: Seny Dieng, Danny Amos, Shane Blaney, Will Longbottom.
Rotherham (4-3-3): Lewis Price; Matt Olosunde, Michael Ihiekwe, Richard Wood, Clark Robertson; Ben Wiles, Shaun MacDonald (Matt Crooks 69), Jamie Lindsay; Carlton Morris (Michael Smith 80), Freddie Ladapo, Jake Hastie (Joe Mattock 76). Subs not used: Laurence Bilboe, Adam Thompson, Dan Barlaser, Julien Lamy.
Referee: Martin Coy (Durham).
Attendance: 11,407 (3,392).