Derby day went from ecstasy to agony for Doncaster Rovers as Rotherham United scored twice in stoppage time to claim a dramatic victory.
John Marquis struck home superbly to put Rovers in front on 39 minutes with his tenth goal of the season.
Tom Anderson and Alfie Beestin were stretchered off in the second half but Rovers appeared to be on course for their first win at Rotherham since 1985 only for the game to be turned on its head inside 12 minutes of stoppage time.
Michael Smith headed home an equaliser just after the clock ticked past 90 minutes and worse was to follow for Rovers - in the 103rd minute - when Smith was tripped in the box by Marko Marosi and Joe Newell buried the penalty with the last kick of the game.
Rovers' game-plan had threatened to work a treat as they stopped Rotherham getting into their stride in the first half and were able to frustrate the hosts and break-up play following Marquis's goal.
But they came under severe pressure from the in-form hosts and buckled at the death in devastating fashion.
Darren Ferguson will have been the happier of the two managers early on as his side pressed well and stopped Rotherham getting into any sort of rhythm.
Rovers had the best attempt of a quiet opening to the game when Anderson headed James Coppinger's long ball towards goal but Marek Rodak was equal to it.
The hosts gradually grew into the game and had a string of half chances around the half hour mark. David Ball acrobatically volleyed over, Joe Mattock saw a goal-bound shot blocked and Ball couldn't get enough on a dangerous cross from Anthony Forde.
Rotherham had cranked it up a notch but it was Rovers who broke the deadlock on 39 minutes - and the goal came from their impressive pressing.
Centre back Semi Ajayi was robbed by Alex Kiwomya, he then fed Marquis who cut it onto his left foot and fired a powerful effort past Rodak.
Rovers were dealt a big blow shortly after the re-start when the effective Anderson was forced off after a nasty-looking collision with Marko Marosi.
Will Vaulks immediately rose well to head a corner just over the bar, while at the other end Richie Towell had to make a good block to prevent Tommy Rowe doubling Doncaster's advantage.
When Richard Wood's header from another corner was blocked on the line and Towell's effort on the follow-up was deflected just wide it looked like being a long final half hour for the visitors.
Substitute Joe Wright made a brilliant goal-saving block to keep out another powerful shot from Towell before Beestin became the second Doncaster player to depart on a stretcher following a heavy challenge from Wood.
The stoppages added up to 12 minutes of added time and the Millers levelled not long after the fourth official's board had gone up. Joe Newell sent a dangerous inswinging free-kick over from the right and Smith rose to plant a header past Marosi.
Roared on by the home support Rotherham pushed for a winner and went close from Newell before referee Geoff Eltringham judged that Marosi had tripped Smith and Newell did the rest.
Rotherham: Rodak, Emmanuel, Mattock, Wood (Palmer 90), Ajayi, Forde (Williams 79), Towell, Vaulks, Newell, Smith, Ball (Lavery 83). Subs not used: Price, Taylor, Yates, Cummings.
Rovers: Marosi, Alcock, Anderson (Wright 56) , Boyle, Mason, Whiteman, Rowe, Beestin (Blair 78), Coppinger (Houghton 90), Kiwomya, Marquis. Subs not used: Lawlor, Baudry, Kongolo, May.
Referee: Geoff Eltringham
Attendance: 11,725 (2,624)