Hearts eventually saw off nine-man Hibernian in a chaotic Edinburgh derby to restore their cushion at the top of the Scottish Premiership to three points after another frantic weekend in the title race.
Hibs - energised by the prospect of hindering their bitter rivals' hopes - took the lead through the departing Martin Boyle after seven minutes amid a febrile atmosphere at Easter Road.
But moments of madness from goalkeeper Raphael Sallinger, who handled outside his box in the 14th minute, and Felix Passlack, who picked up a second yellow moments into the second half, put Hibs in a precarious position.
Hearts huffed and puffed, with substitute goalkeeper Jordan Smith producing save after save to frustrate them and Marc Leonard rattling the crossbar.
But Hibs' brave resistance was eventually breached when a combination of Lawrence Shankland and Warren O'Hora bundled the ball over the line to equalise, with an own goal awarded against the Hibs centre-back.
Derek McInnes' side pushed for a potentially precious winner, but the ball would not fall for them as a tortured away support started to lose faith.
But the goal would eventually come through Blair Spittal, the midfielder sliding the ball past Smith with the aid of a deflection with only a few minutes remaining.
Hearts' lead over Celtic once again stretches to three points, while they go four clear of Rangers, who lost to Motherwell earlier in the day.
Edinburgh derbies can often be horrible to watch. Plenty of grit, to put it diplomatically. But these fans are rarely treated - if you can use that word - to a contest as agonising as this was.
For so long, the supporters in the away end were just waiting. Waiting and waiting and waiting. The equaliser had to come, surely? Then the winner... another wait.
But the goals arrived in timely fashion. 'Believe' is the word that has been scrawled across the training ground and across the bed sheets in the away end.
Games like this, and goals like that from Spittal, keep the fire roaring.
After all, not since 1957-58 have Hearts beaten Celtic, Rangers and Hibs home and away in the same season.
As for Hibs, it was a long, long stay of execution.
Defeat felt inevitable after the second red card, but enough time had elapsed before the goals to give the home fans hope they could hold on.
Yes, Hearts dominated possession, had an xG of 1.8, and enjoyed more than 50 touches inside the Hibs box. But some of the saves substitute Smith was making made you think that maybe it was his story today.
Corners, Hearts' deadliest weapon this season, were cleared. Crosses were swept away or gathered by the keeper. Hearts resorted to pot shots at one point.
While both sides panicked, at the hour mark it seemed Hibs were still doing the right thing. Absorb the pressure, waste time, kill the tempo and play it smart.
Then Boyle went off, grief-stricken to have played his last Edinburgh derby, and a minute later, Hearts had scored.
The balls up top stopped sticking. Cracks started to show. And they eventually told.
