Goal machine Mark Durnan grabbed a crucial win for Dundee United against Ayr United to close in on their promotion play-off rivals.
The Tangerines, who had suffered a serious form slump in the league, now sit just a point behind both Falkirk and Morton in the Championship table.
They took the lead thanks to Simon Murray’s 13th goal of the season after 23 minutes but a penalty from Gary Harkins levelled things up five minutes into the second half.
Then, as he has done a few times this season, Durnan turned from defender into attacker and smashed home the winner on 79 minutes.
It was his fifth goal of the season and as crucial as any other.
United had, of course, lifted the Irn-Bru Cup by beating St Mirren on Saturday and went into this game with some renewed confidence as a result despite their dreadful .
The Tangerines made two changes to the line-up that kicked off at Fir Park on Saturday.
The man whose goal clinched the silverware, Thomas Mikkelsen, was unsurprisingly promoted from the bench to take the place of Nick van der Velden.
Ali Coote, who played so well against the Buddies, was unlucky to drop out and be replaced by Alex Nicholls.
There was also a place on the bench for new boy Wato Kuate, with the 21-year-old Cameroon-born Portuguese midfielder having signed a deal until the end of the season.
The game took a while to get going and the first decent move came for the home team on 21 minutes.
A nice lay-off from Mikkelsen played in Tony Andreu, whose shot from the edge off the box was wide.
The Tangerines only had to wait a couple of minutes more for the opener, though.
It was a marvellous double nutmeg by Murray that did the damage.
The striker absolutely skinned Ayr skipper Nick Devlin on the left, playing the ball through his legs.
Murray then kept his composure to drive his shot between the legs of keeper Greg Fleming from a tight angle and into the net to make it 1-0.
Former Dundee favourite Harkins tried to hit back for the visitors on 27 minutes but Durnan got in the way.
Conrad Balatoni had a header saved by home goalie Cammy Bell before Nicholls almost pounced on a Mikkelsen knock-down.
On 37 minutes, there were shouts for a penalty from the home fans when Mikkelsen went down in the box but referee Barry Cook was unimpressed.
As half-time approached, the Tangerines kept driving forward and Andreu’s cutback went behind Murray then Nicholls saw his cross sweep across the face of goal with no takers.
United’s lead lasted just five minutes of the second half, with them throwing it away by conceding a penalty.
Andreu was the guilty party, tripping Rab Crawford as the Ayr man tried to moved away from him.
Up stepped the reliable Harkins to send Bell the wrong way and level the score.
Ayr then took scorer Harkins off in a surprise move, bringing on former Tannadice forward Farid El Alagui just after the hour.
On 63 minutes, United’s Andreu tried shot from just out of the area and keeper Fleming palmed it away only as far as Nicholls, who fired the rebound into the side-netting.
Coote came on for Nicholls on 70 minutes and the hope was the teenager would provide the spark that led to the winner.
It was Murray, though, who had a great chance to make it 2-1 on 74 minutes when he cleared a path inside the box but saw his low shot saved by Fleming on the deck.
Much to the relief of their worried fans, the Tangerines got back in front on 79 minutes thanks to the deadly Durnan.
The central defender had travelled upfield for a corner from the right that was taken by Charlie Talfer.
The kick was cleared to the edge of the box by Fleming but Murray headed it back to Durnan, who hooked a fabulous shot into the net.
Coote had a shot blocked as United pressed again then El Alagui had the ball in the home net on 84 minutes but he knew it was going to be chalked off for offside as he produced the finish.
Murray then ran forward and let fly from 30 yards but the strike was high, wide and not so handsome.
With the match into stoppage-time, Kuate was given his debut as he replaced Murray.
There was still time for some late drama as Durnan and Stewart Murdoch combined to clear off the line and break Ayr hearts.
With that panic over it was game over and all three points were staying at Tannadice.
Attendance: 4,661.
Dundee United: Bell, Durnan, Edjenguele, Telfer, Robson, Flood, Murdoch, Murray (Kuate 90), Nicholls (Coote 70), Andreu, Mikkelsen. Subs not used: Zwick, Dixon, Donaldson, Van der Struijk, Van der Velden.
Ayr United: Fleming, Devlin, Boyle, Gilmour, Rose, Crawford (McGuffie 84), Moore (Forrest 72), Harkins (El Alagui 61), Meggatt, Balatoni, Docherty. Subs not used: Hart, Murray, Cairney, Wardrope.
Referee: Barry Cook.