Substitute Stephen Humphrys scored a stunning stoppage-time goal from his own half as Hearts capitalised on a first-half red card for Dundee United captain Ryan Edwards to fight back and claim a 3-1 victory at Tynecastle.
The visitors, despite being bottom of the cinch Premiership, were in command of proceedings in the early stages and they took a ninth-minute lead through Steven Fletcher.
But Edwards’ dismissal just before the half-hour allowed the hosts to eventually seize the upper hand and they secured the three points with goals in the closing 20 minutes from captain Lawrence Shankland and substitutes Alex Cochrane and Humphrys.
Hearts made two changes to the team that started Wednesday’s 3-0 defeat by Rangers as Alan Forrest and Andy Halliday replaced Garang Kuol and Cochrane.
United boss Liam Fox also opted for two alterations to the side that lost 1-0 at Kilmarnock in midweek as Ross Graham and Arnaud Djoum made way for Ilmari Niskanen and Craig Sibbald. They were then forced into a third tweak just before kick-off when Jamie McGrath picked up an injury in the warm-up and his place was taken by Peter Pawlett.
United made a bright start and went ahead with the first chance of the match in the ninth minute when Niskanen’s cross was intercepted by Kye Rowles but Fletcher pounced on the loose ball to slot home from close range.
The visitors were well on top in the early stages, with the home crowd growing increasingly frustrated as the match wore on.
However, United suffered a significant setback in the 29th minute when captain Edwards was shown a straight red card following a VAR review for an aggressive challenge on Halliday.
Despite having the extra man, Hearts struggled to carve any clear chances before the break. Indeed it was United striker Fletcher who threatened to add to his side’s lead with three attempts in the closing minutes of the half.
Hearts boss Robbie Neilson responded to his side’s poor first-half display by sending on Humphrys in place of Forrest for the start of the second period.
The Jambos cranked up the pressure and they eventually forced the equaliser in the 71st minute when Barrie McKay’s ball into the box found Shankland, who took it down on his chest and fired home from 15 yards with the aid of a deflection off Scott McMann.
And six minutes later they went ahead with a brilliant team goal as Cochrane burst into the box and fired home a low angled shot after excellent play by Jorge Grant, Kuol, Humphrys and McKay to work it from near the Jambos’ own corner flag into the danger area.
Hearts were reduced to 10 men in stoppage time when Josh Ginnelly was red-carded after applauding referee Nick Walsh as he was about to be booked for time-wasting. Humphrys, though, sealed the win with the last kick when he produced an audacious finish from just inside his own half as Hearts launched a counter-attack.