Hearts defeated Kilmarnock for the second time in five days to seal a place in the fifth round of the Tennents Scottish Cup.
Lee Wallace put Hearts in control of the fourth-round replay after a one-two with Dennis Wyness.
And Lee Miller doubled their lead with a header after Simon Ford had brushed Paul Hartley's free kick towards him.
Deividas Cesnauskis extended Hearts' lead from short range shot before Kris Boyd scored an injury-time penalty.
Hearts will now meet Livingston at Tynecastle on 26 February.
It was the sixth meeting between Hearts and Kilmarnock this season - with Saturday's 3-0 win for Jambos leaving Killie boss Jim Jefferies desperate for an improved performance.
But Killie went into the game without injured duo Gary Locke and Colin Nish, with Kris Boyd and Steven Naismith coming in.
And the two new faces had little opportunity to make their mark before Hearts had raced into their quick-fire two-goal lead.
Wallace, 17, scored his first goal for the club from 12 yards after unlocking the Killie defence with his neat one-two.
And there was further disappointment Jefferies as his team's awful start to the game continued when Miller's header wrong-footed the keeper after 13 minutes.
Boyd almost pulled one back at the near post from a low cross by Naismith, but the striker drilled the ball wide.
After the dramatic opening, clear-cut opportunities were at a premium through the remainder of the opening half.
Killie midfielder Peter Leven shot narrowly wide from 30 yards, while Boyd header weakly wide after a good cross from Garry Hay.
Hartley made a good save shortly after the resumption of play to prevent Killie slipping 3-0 down after a well-struck shot from Cesnauskis.
But they could not prevent the Lithuanian from making it 3-0 when Saulius Mikoliunas' threaded pass found space for him in the Killie area.
Hartley came close to making it 4-0 late on but shot just over with a curling attempt from the edge of the box.
Kilmarnock scored a consolation with the last kick of the game when Boyd scored from the penalty spot after Wallace had pulled down Allan Johnston.
Kilmarnock: Combe, Lilley, Hay, Ford, Fontaine, McDonald, Invincibile, Johnston, Leven, Boyd, Naismith (Murray 70).
Subs Not Used: Bell, Fowler, Dargo, Dodds.
Booked: Boyd, McDonald, Hay.
Goals: Boyd 90 pen.
Hearts: Gordon, Neilson, Wallace, Pressley, Webster, Hartley, Simmons (MacFarlane 81), Cesnauskis, Wyness (Burchill 75), Miller (Thorarinsson 84), Mikoliunas.
Subs Not Used: Moilanen, Berra.
Booked: Pressley, Simmons.
Goals: Wallace 6, Miller 13, Cesnauskis 57.
Ref: J Rowbotham (Scotland).