A stoppage-time strike by Rudi Skacel maintained Hearts’ grip on third place in the SPL and ended a run of three matches without victory.
On the back of losses to Kilmarnock and Dundee United, the Jambos were eager to get back to winning ways against second-bottom St Mirren, but they twice had to come from behind to get all three points.
Buddies striker Michael Higdon had two ideal chances to put Danny Lennon’s side ahead early in the game before he finally managed to do so.
In the first minute, Steven Thompson found Aaron Mooy on the right and the Australian sent in a cross for his towering team-mate, but the Englishman’s weak shot was saved by Hearts keeper Marian Kello.
Then, Thompson got to the byline to set up Higdon who looked certain to score, but he fluffed his attempt from six yards – the ball bouncing off his standing foot and rolling meekly towards the Hearts goal.
Perhaps embarrassed by that, he made no mistake in 15 minutes when presented with his third chance. Kenny McLean’s free-kick into the box was knocked back across goal by centre-half Darren McGregor and Higdon looped a header over Kello from eight yards.
Skacel flashed a low drive wide of Saints keeper Paul Gallacher’s post and, at the other end, St Mirren were denied a second goal on the half-hour mark when Paul McGowan crashed a shot from Thompson’s pass off the inside of the post and home defender Craig Thomson made a timely block on Mooy’s rebound effort.
Hearts boss Jim Jefferies sent on Andy Driver and Scott Robinson as disappointing duo Adrian Mrowiec and David Obua made way.
David Templeton hit a shot over the bar from the edge of the box as Hearts tried to get a foothold in the match and it was not too long before fans’ favourite Skacel levelled.
The Czech midfielder managed to get clear of Saints’ Jim Goodwin, worked the ball on to his left foot and cracked a shot past Gallacher from 20 yards, the keeper left with no chance.
The equaliser on 55 minutes changed the tone of the match for the next quarter-of-an-hour, at which point Higdon scored his second – a delightful turn and shot into the top corner from the same distance as Skacel had found the net.
ST Mirren had won three times on the road prior to this match, once more than in Paisley, and for the remainder of the match their fans were nervous that they might not be able to hang on to make it a quartet of away wins. Their sense of unease was heightened when Hearts defender Marius Zaliukas knocked the ball down to Skacel, but his overhead kick was turned away by Gallacher.
Ryan Stevenson was in the mood to try his luck and, moments before making it 2-2, he hit a long-range shot into the side netting.
His equaliser was a poor one from the Buddies’ point of view, their inability to defend an 82nd-minute throw-in punished when Stevenson blasted beyond Gallacher for his fourth goal of the season.
Incredibly, and barely deserved, Hearts won the game in the third minute of injury time.
A corner by Thomson was knocked on by Robinson and Skacel was there to blast in the winner and leave Lennon’s side utterly dejected.
Hearts: Kello, Obua, Webster, Thomson, Zaliukas, Palazuelos, Black, Templeton, Skacel, Mrowiec, Elliot.