Dundee dramatically came from two goals down to beat Dunfermline in a frenetic Championship encounter at Dens Park.
The Dark Blues moved three points ahead of the Pars and level with Raith Rovers in second place after their 3-2 success.
For the second time in two weeks, defender Lee Ashcroft was the hero in front of goal as he headed in the winner.
That was after defensive errors had given the visitors an early 2-0 lead with Kevin O’Hara and former Dee Craig Wighton on target.
A string of superb saves from Dunfermline keeper Owain Fon Williams, however, couldn’t keep Dundee out as they recovered through Jason Cummings and Danny Mullen goals.
They came side of half-time before Ashcroft’s header earned a massive victory for his side.
Dundee made two changes with experienced defender Liam Fontaine returning after injury in the place of youngster Sam Fisher.
Also in was Osman Sow for Mullen in attack while Charlie Adam was banned after picking up too many bookings.
Dunfermline, meanwhile, made five changes from their Scottish Cup disappointment at Morton with former Dens favourite Wighton in from the start.
Also coming in were Paul Watson, Iain Wilson, Fraser Murray and Dom Thomas.
The two sides were neck and neck in the mad rush for the play-off places, alongside Inverness and Queen of the South after they won earlier in the day.
And there was a mad rush of goals in a frenetic night at Dens Park.
It was the away side who settled quickest and romped into a quickfire 2-0 lead.
Dundee were masters of their own downfall, however.
First Christie Elliott poked the ball away from Wighton and into the danger zone where O’Hara swept home.
Then Fontaine dallied and saw his clearance blocked. Ashcroft tried to sort it out but saw his clearance blocked and sent Wighton through on goal.
The finish from the former Dee was exquisite as he chipped Adam Legzdins from 16 yards after just six minutes.
On 13 minutes the home side went close to halving the deficit as Ashcroft rose highest but he couldn’t add to his two goals at Alloa the week before as he nodded wide.
Paul McMullan then brought a good save from Owain Fon Williams with a fierce low effort before Max Anderson saw his rebound blocked inside the six-yard box.
Dundee did find a route back into the match on the half-hour mark despite incredible work from Pars keeper Fon Williams.
Sow gathered a deflected Anderson shot and fired a volley goalwards only to see the goalie beat it out. The ball fell straight back to the Swede with what looked an open goal but somehow the keeper was there again with a tremendous save. Cummings, though, was on hand to tidy things up and head into the empty net.
Moving into first-half stoppage time Ashcroft again had a decent chance with his head but couldn’t find the target.
After the break, Dundee were inches away from levelling things up as Cummings sent substitute Danny Mullen through.
His effort was tipped onto the bar by Fon Williams and Dunfermline kept their lead.
Seconds later, again the goalie was at full stretch with another top save to keep out an Ashcroft header.
But Mullen was there to smash into the top of the net from two yards.
By minute 56, Dundee were ahead. Paul McGowan corners to Lee Ashcroft’s head was a successful formula twice against Alloa.
Once more it paid off as the big defender made up for his earlier mistake to head into the corner.
And the chances kept coming as the Dark Blues filled with confidence – Ashcroft met another McGowan corner but headed well wide before McMullan smashed a shot over.
With 25 minutes to go an injury to Watson saw the Pars change shape as former Dundee target Ewan Henderson, on loan from Celtic, came on.
Mullen, though, almost got his second as he nodded just wide of the far post seconds later.
On 68 minutes, the same man thought he’d found the corner only to see Fon Williams pull off another top save and then keep out Cummings’ rebound.
Ten minutes later Cummings went for goal from 20 yards but yet again the Pars keeper was in the way.
Dunfermline sent on subs Scott Banks and Declan McManus and started piling on the pressure.
Former Dundee United man Banks was a real threat. First he forced a save from Legzdins from a free-kick before seeing a shot fly just wide of Legzdins’ post via a deflection with five to go.
However, James McPake’s side rode out the storm to seal what could be a pivotal victory in the race for second place.
Dundee: Legzdins, Elliott, Fontaine, Ashcroft, Marshall, McGowan, Anderson (Byrne 86), McDaid, McMullan, Sow (Mullen 39), Cummings (Afolabi 90).
Subs not used: Ferrie, Kerr, Cameron, Fisher.
Dunfermline: Fon Williams, Comrie, Edwards, Murray, O’Hara (McManus 70), Wighton, Wilson, Murray, Mayo, Thomas (Banks 70), Watson (Henderson 66).
Subs not used: MacDonald, McCann, Gill, McInroy.
Referee: Bobby Madden.