An 81st-minute penalty from captain Barry Robson and injury-time goal from Collin Samuel completed a stunning comeback for Dundee United against 10-man Aberdeen.
The visitors came close to taking the lead in the first half when Gary Dempsey struck the crossbar with a free kick, and broke the deadlock in the 56th minute as Scott Severin scored from close range.
The match soon turned.
Aberdeen defender Michael Hart was sent off for receiving his second yellow card just after Collin Samuel's equaliser, and Robson went on to score from the spot, before Samuel netted a breakaway third.
Aberdeen suffered a blow ahead of the match, as captain Russell Anderson and in-form midfielder Barry Nicholson were both ruled out with the flu.
It was United, unchanged from their 2-2 draw with Celtic on Tuesday, who made the better start to the game.
Craig Conway should have given the home side the lead in the sixth minute following Robson's inch-perfect cross, but the unmarked left-midfielder sent his header wide of goal despite being stationed only six yards out.
United continued to push forward and after a low Robson drive was saved by Aberdeen goalkeeper Jamie Langfield, Samuel believed he should have been awarded a penalty when he appeared to be pulled back by Andrew Considine.
Referee John Underhill chose not to award a spot-kick and perhaps inspired by that let-off the away side began to dominate.
United goalkeeper Derek Stillie was forced into action by a Lee Miller header in the 16th minute, while Severin saw the 33-year-old push a powerful drive over the crossbar shortly afterwards.
Stillie then produced a wonderful save to deny Miller after Richard Foster had flicked on a cross from Maguire, while Gary Dempsey came agonisingly close to breaking the deadlock when his searing 30-yard free kick struck the underside of the United crossbar.
The start of the second period was controlled by Aberdeen and it was no surprise when they took the lead 11 minutes after the restart.
Substitute Steve Lovell drew Garry Kenneth into a foul on the left wing.
The United defender was cautioned and from Dempsey's low delivery Severin slid the ball into the net from only two yards.
However, Aberdeen's advantage lasted only five minutes as Robson's free-kick from the right found the head of Samuel, who glanced the ball past Langfield to score the equaliser.
Aberdeen's afternoon began to deteriorate, and Hart received his second caution of the game for a foul on Conway - and an inevitable red card.
With a one-man advantage, United's continued to surge forward.
And with 15 minutes remaining a free-kick from Robson was carelessly spilled by Langfield inside his goal area, with Lee Mair and David McCracken both failing to capitalise.
Langfield then made an even bigger error in barging into David Robertson, who was trying to reach a pass from substitute David Goodwillie. A penalty was awarded and Robson emphatically scored from 12 yards.
A pulsating match ended on a high note for United as Samuel finished a counter-attack after cutting inside the cruelly exposed Considine, before beating Langfield with a well-placed shot.
Teams:
Dundee Utd Stillie, Mair, McCracken, Kenneth, Duff,Smith (Goodwillie 76), Kerr, Robertson (Cameron 90), Robson,Conway, Samuel.
Subs Not Used: McLean, Archibald, Brewster, Proctor, Watson.
Booked: Smith, Kenneth, Mair.
Goals: Samuel 62, Robson 81 pen, Samuel 90.
Aberdeen Langfield, Hart, Diamond, Considine, Foster, Clark,Severin, Dempsey, Maguire (Lovell 46), Mackie,Miller (Touzani 71).
Subs Not Used: Soutar, Daniel Smith, Winter, Donald, Daal.
Sent Off: Hart (66).
Booked: Hart, Foster.
Goals: Severin 56.
Att: 12,329
Ref: J Underhill (Scotland).