Yutaro Oda scored a late winner as spirited Hearts produced a rousing fightback from two goals down to beat Dundee 3-2 and move eight points clear in third place in the cinch Premiership.
The Jambos looked in trouble when they trailed at the break through goals from Jordan McGhee and Lyall Cameron.
But they turned things around with second-half goals from Calem Niewenhof, recent recruit Dexter Lembikisa and substitute Oda.
Captain Lawrence Shankland would have been particularly relieved with the outcome as he saw a penalty saved by Trevor Carson at 2-1 down.
Shankland was back to lead the team after he missed Saturday’s Scottish Cup win at Spartans through illness, while goalkeeper Zander Clark was restored to the starting XI after being rested at the weekend to allow the fit-again Craig Gordon to get a first outing in 13 months under his belt after injury.
Dundee goalkeeper Carson returned after missing the Scottish Cup defeat at Kilmarnock, while on-loan Burnley left-back Owen Dodgson made his first start after a debut appearance off the bench at Rugby Park.
After a cagey opening 10 minutes in which both sides tried to adapt to the swirling wind around Tynecastle, Hearts pair Kenneth Vargas and Nieuwenhof threatened in quick succession with shots from the edge of the box.
Stephen Kingsley then glanced a free header wide from Alex Cochrane’s corner in the 15th minute.
Dundee went ahead in the 19th minute, just seconds after Clark had pulled off an excellent save to keep out Zach Robinson’s header from an Amadou Bakayoko cross.
Former Hearts player McGhee pinged a lovely finish beyond the Jambos keeper from just inside the box after Bakayoko cushioned Dodgson’s cross back into his path. The goal was initially ruled out for offside but allowed to stand after a VAR check.
Shankland and Vargas both spurned good chances to bring the hosts level before Dundee doubled their lead in the 38th minute.
Dara Costelloe seized on some loose play from Hearts and nicked the ball off Lembikisa just outside the box before slipping a pass through to Cameron who slotted low past the exposed Clark.
Hearts – booed off at the break – began the second half with renewed intensity and purpose, however, and got themselves back in the game in the 57th minute through a low 25-yard drive from Nieuwenhof.
The Jambos were given the chance to equalise in the 65th minute when they were awarded a penalty after Dodgson was deemed to have shoved Shankland as he tried to get on the end of a Kingsley cross, but Shankland missed his third spot-kick in succession as Carson got down to his right to make the save.
Hearts were not to be denied, though. They eventually got themselves level in the 74th minute when Lembikisa – making his first start since joining on loan from Rotherham – headed home Alan Forrest’s cross from the left.
And the winner came in the 86th minute when substitute Oda turned and fired high past Carson, with the aid of a deflection off Joe Shaughnessy, after being fed by Forrest just inside the box.