Hearts have survived a Spartans scare to avoid a Scottish Cup shock and book their place in the fifth round with an injury time victory.
The Premiership club grabbed a 92nd minute winner against their Edinburgh neighbours from League Two on Saturday afternoon.
Scotland goalkeeper Craig Gordon made his long awaited return from injury after more than a year out injured and he captained the side at Ainslie Park.
The 41-year-old suffered a double leg break on Boxing day in 2022 and has been fighting his way back to fitness ever since.
He could now potentially be in contention for a place in Steve Clarke’s Scotland squad for Euro 2024 being held in Germany this summer.
But it was his opposite number Blair Carswell in goals Spartans that stole the limelight with an impressive performance for the home side that earned him the man of the match award.
Kenneth Vargas put Steven Naismith’s side ahead with a goal in the first half against the League Two side but James Craigen fired Spartans level with a peach of a strike in the second-half.
And just as it looked as though the game was heading to extra-time, Frankie Kent popped up with a header from a corner to score the winner in the 92nd minute.
Scotland forward Lawrence Shankland missed the game through illness amid speculation of a potential January move away from the club.
Hearts dominated the early possession as they looked to put the game away early and they got their reward when Vargas headed home to make it 1-0 after 12 minutes.
Gordon was called in to action ten minutes later as Spartans pushed for an equaliser and he rolled back the years with a finger tip save from a Booth effort to keep his side ahead.
Alan Forrest had a couple of chances to double the lead in quick succession with Vargas and Tagaway also coming close to getting the second as the first-half came to an end.
In the second-half Vargas, Kent and Halkett all had early chances but Spartans keeper Blair Carswell done well to keep the score at one.
Spartans grabbed the equaliser against the run of play when Craigen fired a 20-yard volley past Gordon to make it 1-1 with 25 minutes to go.
Carswell made another great save from point blank range from Jorge Grant with ten minutes remaining to keep the score level.
Kent scored the winner in the 2nd minute of injury-time after a corner from Cochrane to avoid extra-time and put Hearts into the next round.
The draw for the fifth round will take place after Celtic vs Buckie Thistle on Sunday with Hearts joining Aberdeen in the hat ahead of the rest of the fixtures on Saturday.
STV News is now on WhatsApp
Get all the latest news from around the countryFollow STV News
Follow STV News on WhatsApp
Scan the QR code on your mobile device for all the latest news from around the country