Hearts set up a Scottish Cup semi-final with Celtic after strikes from Jamie Hamill and Rudi Skacel sank St Mirren in an entertaining replay in Paisley.
St Mirren's Graham Carey had an early penalty saved by Jamie MacDonald after a handball from Marius Zaliukas.
And the home side were aggrieved that advantage was not played as Nigel Hasselbaink put the ball in the net.
Hamill thundered a shot home on 31 minutes, shortly after hitting the post, and Skacel pounced late on.
Striker Craig Beattie, a Buddies target before he opted for a move to Tynecastle, led the line impressively for the visitors, while marauding full-back Hamill was a threat throughout the opening 45 minutes.
It was an own goal from Zaliukas that earned the Buddies a 2-2 draw in the original tie.
And the Hearts skipper was again in generous mood as he conceded a penalty after a good spell for the home side.
Skacel sent an angled shot wide in the opening minute but the Buddies responded with a period of sustained attacking pressure.
MacDonald palmed away a Carey cross, with Hasselbaink and Thompson in close attendance, before the goalkeeper saved after Jim Goodwin failed to connect cleanly with another Carey delivery.
The same source led to the penalty as Zaliukas brushed the ball with an outstretched hand while challenging Thompson in the air.
Hasselbaink found the net with his head from the loose ball but referee Stevie O'Reilly's whistle had already gone.
Carey's resulting spot-kick was well struck low to the right and MacDonald made an excellent diving save.
Saints goalkeeper Craig Samson saved from Andrew Driver before a fierce 25-yarder from Hamill cannoned off the inside of the post.
Eight minutes later, Hamill took advantage of a poor clearance from Marc McAusland to power a shot from the edge of the penalty area into the bottom corner.
Samson saved a swerving Beattie shot, Ian Black shot wide and Hamill blazed wildly over as Hearts finished the half in the ascendancy.
The visitors had the majority of possession in the opening stages of the second half, without seriously threatening Samson's goal.
And St Mirren failed to impose themselves on the game, with Beattie holding the ball up well for Hearts.
When the Saints did get a glimpse of goal, Hasselbaink sliced wide and MacDonald parried clear a Teale shot.
With four minutes remaining, Driver capitalised on sloppy St Mirren defending and found Skacel, who tucked the ball beyond Samson to seal victory.