Hearts finally saw off Livingston on penalties to reach the quarter-finals of the Scottish Cup.
After Cristian Montano hit the post from 12 yards, Hearts goalkeeper Craig Gordon was his team’s hero after keeping out Ayo Obileye to seal a 4-3 spot-kick victory.
Hearts had dominated long spells of the game but struggled to find a way past a Livingston team who defended for their lives.
Bruce Anderson twice went close for the Lions in the first half while Scott Pittman saw a deflected effort come back off the post.
For Hearts, Barrie McKay, Ellis Simms and John Souttar were among those denied by Livingston goalkeeper Max Stryjek.
In a lively start to the game Livingston registered two shots on target inside the first 10 minutes.
Only four minutes were on the clock when Anderson ran clear but his low drive was blocked by Gordon.
In another counter from the visitors, Anderson ran at John Souttar before moving the ball on to his left foot but his drive from 18 yards was straight at the Scotland keeper.
In between those efforts, Livingston defender James Penrice made a well-timed last-ditch tackle to deny Andy Halliday a clear shot at goal, with appeals for a penalty waved away by referee Nick Walsh.
Hearts were seeing plenty of possession and Mackay forced Stryjek into a save down at his near post with a drive from outside the area before finding Simms in the box. The on-loan Everton player glided away from Jack Fitzwater but his shot from a tight angle was blocked by Stryjek.
There was no shortage of effort from both teams in the driving rain at the start of the second half, although there was a distinct lack of clear-cut openings.
Hearts manager Robbie Neilson turned to his bench for inspiration and brought on Liam Boyce and Gary Mackay-Steven on the hour mark.
Livingston went agonisingly close to breaking the deadlock in the 72nd minute when Pittman’s shot hit Souttar and came back off the upright, with Gordon diving onto the rebound.
Moments later at the other end the ball fell kindly to Simms but his low effort was turned behind for a corner by Stryjek.
Simms then glanced a header over from a Mackay-Steven delivery before Stryjek tipped over a Souttar header from close range after the defender got on the end of a Kingsley corner.
Livingston had the ball in the net through Montano in the 82nd minute but the effort was ruled out for offside.
Hearts kept up the pressure in extra time and Stryjek pulled off an excellent point-blank save to deny Haring after the Austrian met McKay’s cross.
Boyce then fired a Simms lay-off over the bar.
At the start of the second period of extra time Lions midfielder Pittman had a great chance but he headed wide at the back post from Penrice’s deep cross.
Hearts emerged victorious 4-3 on penalties after Lions pair Montano and Obileye both failed to convert from 12 yards.