Dundee secured their first William Hill Premiership win of the season in a 3-2 thriller with Livingston at Dens Park.
The Dark Blues opened the scoring in the first half through Simon Murray and then doubled their advantage after the break with Joe Westley on the mark.
However, home nerves were jangling when Clark Robertson scored an own goal with the same player then conceding a penalty, which was converted by Jeremy Bokila.
It looked like both sides would have to settle for a share of the spoils, but the Dundee were awarded a penalty of their own deep in stoppage time, which was blasted home by substitute Callum Jones.
The hosts started brightly but Livi had the first opportunity of the game in the seventh minute when Robbie Muirhead beat Ryan Astley on the right wing and then advanced on goal, but his shot from a tight angle was bundled away for a corner by Dundee goalkeeper Jon McCracken.
Instead, it was the hosts who finally broke the deadlock in the 43rd minute. Cameron Congreve made space down the right and produced a pin-point low cross to present Murray with a tap-in from close range past the helpless Livi goalkeeper Jerome Prior.
Dundee looked to pick up from where they left off at the start of the second half, with Fin Robertson having an early sight at goal but the midfielder dragged his low shot wide.
The impressive Congreve then embarked on a rampaging run before chopping back and hitting a low shot, with Prior pulling off an outstanding one-handed diving save.
However, it was not long before the second Dundee goal came in the 66th minute when Fin Robertson played in Congreve, who cut the ball back to Westley for another tap-in – his first goal since signing for the club last month.
The hosts seemed to be in complete control, but Livi were handed a lifeline in the 74th minute when Clark Robertson turned a cross into his own net.
And the defender’s day went from bad to worse when he brought down Lewis Smith inside the Dundee box, with referee Ross Hardie pointing to the spot. Substitute Bokila stepped up and fired a powerful penalty past McCracken.
Smith had a chance late on, but his effort was cleared off the goal-line.
However, the Dark Blues secured a dramatic victory in the seventh minute of stoppage time when Livi’s Danny Wilson brought down Charlie Reilly inside the box. Referee Hardie pointed to the spot, but was called to the pitchside monitor by VAR.
However, he stuck with his original decision and Jones sent Prior the wrong way with his penalty to the absolute delight of the home fans.
Subscribe or register today to discover more from DonegalLive.ie
Buy the e-paper of the Donegal Democrat, Donegal People's Press, Donegal Post and Inish Times here for instant access to Donegal's premier news titles.
Keep up with the latest news from Donegal with our daily newsletter featuring the most important stories of the day delivered to your inbox every evening at 5pm.