Aberdeen breathed new life into their bid to finish third in the Premiership with a 2-1 victory over Livingston.
Second-half goals from Callum Hendry and substitute Ryan Hedges gave the Dons a commanding lead.
Jay Emmanuel-Thomas flashed in a volley for Livingston in the 80th minute to set up a grandstand finish.
But Aberdeen hung on and closed the gap on Hibernian to just three points with two matches remaining in the campaign.
Livingston enjoyed the better of the opening exchanges and the Aberdeen defence had to look smart to cut out a Jackson Longridge centre that looked destined for the recalled Matej Poplatnik.
Aberdeen burst to life in the 12th minute. With little else on, Lewis Ferguson swerved in a dipping shot from 30 yards that the troubled Max Stryjek was forced to tip over the crossbar.
From the resulting corner, Niall McGinn's second delivery was met flush on the forehead of Hendry but Stryjek blocked brilliantly at his left-hand post.
Moments later, Livingston were back on the front foot and Aberdeen had stand-in goalkeeper Gary Woods to thank for keeping the scoreline blank.
Nicky Devlin's dangerous long throw was flicked on by defender Jon Guthrie and, with Poplatnik poised to find the net at the back post, Woods got a vital punch on the ball.
Aberdeen then survived appeals for a penalty in the 20th minute as the home side continued to press for the opener.
Ferguson was robbed of possession on the edge of his own box by Scott Pittman. who fed the overlapping Nicky Devlin. However, Emmanuel-Thomas' drilled shot from the full-back's cutback was blocked by a sea of red.
Six minutes before the break, the Lions should have scored.
Connor McLennan, booked moments earlier for a kick out at Craig Sibbald, was short with a pass back but Poplatnik screwed his shot wide of the far post with Woods stranded.
And just seven minutes into the second-half, Aberdeen found the breakthrough.
Livingston permitted their visitors too much space on the right and failed to stop McGinn's cross. McLennan's header was somehow deflected onto the crossbar by Stryjek but Hendry was first to the ricochet to bundle in from close range.
The Dons doubled their lead and looked to have sealed victory in the 74th minute.
Flo Kamberi raced clear on the left and his pinpoint cross was perfect for Hedges, who swept a brilliant left-foot shot into the far corner of the net to mark his return from three months out through injury.
However, Livingston threatened a comeback with a stunning counter 10 minutes from time.
Substitute Jaze Kabia angled a sensational diagonal cross into the box from the left and Emmanuel-Thomas spiralled a magnificent volley into the opposite corner of the net.
With just a minute left, Livi howled for a penalty when they claimed the ball struck the arm of Jack McKenzie in the box but referee Grant Irvine waved away the appeals.