A rousing second half from Hearts overhauled Aberdeen's lead to earn three vital points in a fiercely-competitive encounter at Tynecastle Park.
Uche Ikpeazu struck the winner after Sean Clare's penalty had levelled Connor McLennan's early opener for the Pittodrie side.
Ikpeazu was then substituted and stretchered away after suffering a head knock and is now a major doubt for Hearts' next two games against Rangers and Hibs. He missed an open goal shortly before the equaliser but redeemed himself with the winner on a tumultuous afternoon.
Aberdeen seized the initiative in the first half through McLennan's header but a different Hearts side emerged after the interval. Clare's penalty following a foul on Jake Mulraney restored parity. Ikpeazu then capitalised on uncertainty in the Aberdeen defence to score what proved to be the decisive goal.
Conor Shaughnessy returned to the Hearts starting line-up on the left of a three-man defence for this encounter. With Ben Garuccio sidelined for ten months, Jake Mulraney was deployed at left wing-back against an Aberdeen side in a familiar 4-2-3-1 system. Their greatest threat was centre-forward Sam Cosgrove with 18 goals in 35 appearances this season.
A vociferous travelling support followed Derek McInnes' side to Tynecastle and watched a fascinating battle evolve between their two centre-backs, Andy Considine and Scott McKenna, and the Hearts striker Ikpeazu. It was a bruising duel throughout the afternoon between three physical units.
Aberdeen struck first on 15 minutes. Niall McGinn's corner was headed powerfully against the crossbar by Cosgrove and McLennan was in place to head the rebound downwards and into the net from close range. Cosgrove then found himself fortunate to receive a yellow rather than a red card after appearing to lead with an elbow while challenging Christophe Berra.
Hearts fans and manager Craig Levein became exasperated watching Ikpeazu being manhandled at times by Considine and McKenna without referee John Beaton awarding fouls. The Englishman continued hustling and chased a seemingly lost cause down the left flank to win possession from Considine. His low cross evaded the runners in maroon, however.
That was a recurring theme of the first half for the home side. When they got into decent areas out wide, the final ball lacked quality. Consequently they weren't able to work Joe Lewis in the visitors' goal.
At the other end, Zdenek Zlamal was becoming busier. The Czech goalkeeper was at full stretch on 42 minutes to push Cosgrove's looping header from Lewis Ferguson's cross over his crossbar. He then fisted away Graeme Shinnie's dangerous 25-yard drive moments before the break. The sun was bright at Tynecastle but it was most definitely Aberdeen shining at that point.
Hearts passed up a glaring opportunity to equalise five minutes into the second half. Lewis came out for Berra's long ball near the edge of his penalty area but was distracted by Jamie Brandon arriving to challenge. The goalkeeper failed to collect and the ball dropped for Ikpeazu to stroke into the unguarded net. Somehow, the striker's first-time attempt bounced wide.
The hosts kept forcing the issue and on the hour mark were rewarded for their persistence. A long and incisive run by Mulraney from inside his own half took him inside the opposition penalty box. A challenge by Considine brought him down and Beaton pointed instantly to the spot. Clare confidently tucked the penalty to Lewis' left to bring Hearts level.
Ikpeazu remained a constant menace. He was cautioned for simulation moments later after intercepting a short backpass and falling as he went past Lewis. The same player then took possession following another driving Mulraney run, but his turn and shot landed in Lewis' arms.
Hearts were enjoying their best spell of the afternoon and might have scored again had Wighton shot first time instead of controlling when a cross arrived at his feet eight yards out. Aberdeen smothered the danger quickly but the hosts were dominating and sensing the chance of a winner. Mulraney was heavily involved in their attacks and Considine was booked for pulling down Ikpeazu.
Their pressure brought them a second goal 13 minutes from the end. Shaughnessy's long ball was misjudged by Considine with Ikpeazu lurking. He got a toe to the ball as McKenna arrived to clear and managed to stay on his feet to angle his finish beyond Lewis and into the net – causing Tynecastle to erupt.
Unfortunately for the hosts their cult-hero forward was then forced off. An aerial challenge with Dominic Ball left him floored and looking dazed and he was quickly replaced by Oliver Bozanic. Ikpeazu then required medical attention in the home dugout before being stretchered away, whilst on the field tempers boiled over.
Ball's challenge on Clare prompted an angry melee involving several players from both sides as people jostled, shoved and squared up. Beaton dealt with it by booking Ball, Ferguson, John Souttar and Arnaud Djoum.
Five minutes of stoppage-time were played after the regulation 90 minutes before Hearts could rejoice at claiming a huge victory to boost their chances of a European place.
Hearts (3-4-3): Zlamal; Souttar, Berra, Shaughnessy; Brandon, Haring, Djoum, Mulraney; Clare, Ikpeazu (Bozanic 81), Wighton. Unused subs: Doyle, Godinho, Cochrane, Lee, MacLean, Keena.
Aberdeen: (4-2-3-1): Lewis; Ball, Considine, McKenna, Lowe; Ferguson, Shinnie; McLennan (Devlin 87), Stewart (Wilson 81), McGinn; Cosgrove. Unused subs: Cerny, Gleeson, Halford, May, Campbell.
Referee: John Beaton.