Stephen Kingsley scored a sublime free-kick as Hearts ground out a hard-fought 2-0 victory over 10-man St Mirren at Tynecastle.
The defender doubled the home side’s lead after Gary Mackay-Steven opened the scoring just after the hour mark, with Joe Shaughnessy seeing red late on.
But Robbie Neilson’s side, who climbed back up to second in the Cinch Premiership, did not have it all their own way and rode their luck at times before breaking the deadlock.
The only blot on the afternoon for Hearts was the sight of midfielder Beni Baningime being taken off on a stretcher late in the game with an apparent knee injury.
Hearts had aspirations of bouncing back from last weekend’s defeat at Motherwell but St Mirren made life uncomfortable for their hosts.
Perhaps taking a leaf out of Motherwell’s book, the Buddies pressed Hearts high and ensured they could not find any rhythm.
St Mirren shipped five goals in their last trip to Gorgie two years ago but they started well.
Saints striker Eamonn Brophy had the first attempt at goal after 21 minutes but his low drive from an angle was pushed behind by Craig Gordon at his front post.
Hearts’ first chance came in the 23rd minute when the home side caught their opponents trying to play out from the back.
Barrie McKay teed up Liam Boyce on the 18-yard box but Shaughnessy flung his body in the way of the shot to direct the ball behind for a corner.
Boyce had another chance in first-half injury time but after cutting back on to his right foot inside the box, the forward hit a tame shot straight at Jak Alnwick.
There was no shortage of goalmouth action at the start of the second half. Alnwick made a good save to deny Hearts winger Mackay-Steven at the back post before St Mirren laid siege to the home goal.
Gordon beat away a stinging Jamie McGrath shot from distance and was called upon again seconds later.
Marcus Fraser’s header from a corner was blocked on the line by Boyce and the St Mirren player’s effort on the rebound was then kept out by the Scotland number one.
After Michael Smith should have put Hearts ahead with a close range effort that was blocked by Alnwick, Hearts finally broke the deadlock in the 61st minute.
McKay’s low cross was deflected into the path of Mackay-Steven and the forward swept a first time left-foot shot into the corner of the net.
The points were all-but sealed in the 75th minute when Kingsley launched an exquisite free-kick into the top corner from 25 yards after Charles Dunne fouled Boyce.
Saints captain Shaughnessy was sent off deep into stoppage time after collecting his second yellow card.