Sean Clare's first goal for Hearts edged them past Livingston and into the fifth round of the William Hill Scottish Cup.
The former Sheffield Wednesday midfielder curled home a first-time finish inside three minutes of the second half to earn Hearts a 1-0 win at Tynecastle.
The victory also allowed Hearts some redemption after their 5-0 defeat at the hands of Livingston last month.
The visitors were also the first team to take points off the early Premiership pace-setters in a goalless draw at Tynecastle in September and the hosts were slow to get going.
But they were boosted by the debut performance of Czech target man David Vanecek, who set up the goal with a deft flick and offered Hearts a fruitful outlet up front. On-loan Leeds player Conor Shaughnessy also had a solid introduction in central defence, winning a number of aerial duels.
Livingston had the first few half-chances of a tight opening period. Ryan Hardie got away from Christophe Berra to take down Declan Gallagher's long ball but Colin Doyle was off his line quickly to smother.
Alan Lithgow hooked just beyond the far post after being handed too much room at a long free-kick and Hardie glanced a header wide from a corner.
Hearts began to put together some passing moves towards the end of the half and Olly Lee had a 30-yard strike held before Steven Naismith was correctly flagged offside before netting at the second attempt.
They further stepped up the pace after the restart and Clare curled inside the far post from 16 yards after Vanecek had laid off Naismith's pass first time.
Hearts soon came close after Livingston goalkeeper Liam Kelly fumbled Ben Garuccio's up-and-under but Craig Halkett cleared Callumn Morrison's shot off the line.
Livingston came back into it. Hardie's drilled effort was well saved, Shaun Byrne had a header saved and Gregg Wylde created a great chance by beating two men but then shot well over.
Space was opening up for Hearts as Livi pressed for an equaliser and Morrison had a powerful strike saved before the visitors threw on Chris Erskine for a debut.
Livingston threw more bodies forward and Steven Lawless came close from long range but Hearts withstood the pressure.
There was a final blow for Livi when skipper Halkett landed heavily on his ankle in the dying seconds.