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.
Full Time The game is over, as the referee blows his whistle.
90:00 +1:30 Substitution
Substitution Craig Beattie leaves the field to be replaced by Gary Glen.
90:00 +0:21 Substitution
Substitution Scott Robinson is brought on as a substitute for Ian Black.
Jamie Hamill crosses the ball, Steven Thompson makes a clearance.
Outswinging corner taken right-footed by Ian Black from the right by-line, clearance made by Steven Thompson.
Substitution Suso Santana comes on in place of Rudi Skacel.
Graham Carey challenges Ryan McGowan unfairly and gives away a free kick. Andy Webster takes the free kick.
Assist on the goal came from Andrew Driver.
85:29 Goal scored
Goal - Rudi Skacel - St Mirren 0 - 2 Hearts Rudi Skacel fires in a goal from inside the six-yard box low into the middle of the goal. St Mirren 0-2 Hearts.
The ball is crossed by Andrew Driver,
Booking Jim Goodwin is cautioned.
Foul by Jim Goodwin on Craig Beattie, free kick awarded. Direct free kick taken by Andy Webster.
The ball is sent over by Jamie Hamill, clearance by Lee Mair. Inswinging corner taken by Daniel Grainger from the right by-line, Craig Beattie takes a shot. Save by Craig Samson.
Free kick awarded for an unfair challenge on Ryan McGowan by Graham Carey. Direct free kick taken by Andy Webster.
Foul by Andrew Driver on David van Zanten, free kick awarded. Jim Goodwin takes the free kick.
Substitution (St Mirren) makes a substitution, with Aaron Mooy coming on for Gary Teale.
Rudi Skacel is caught offside. Craig Samson restarts play with the free kick.
Gary Teale crosses the ball, save by Jamie MacDonald.
Unfair challenge on Ian Black by Jim Goodwin results in a free kick. Ian Black takes the direct free kick.
The ball is swung over by Gary Teale.
Gary Teale sends in a cross.
Nigel Hasselbaink produces a right-footed shot from just outside the box that misses to the right of the target.
A cross is delivered by Graham Carey, Marius Zaliukas manages to make a clearance.
Andrew Driver produces a cross.
Rudi Skacel takes a shot. Save by Craig Samson. Corner from the right by-line taken by Ian Black, Header by Marius Zaliukas from deep inside the penalty area misses to the left of the goal.
Substitution Jeroen Tesselaar comes on in place of Hugh Murray.
Ryan McGowan gives away a free kick for an unfair challenge on Steven Thompson. The free kick is delivered left-footed by Graham Carey from left wing, Darren Barr manages to make a clearance. Inswinging corner taken by Graham Carey from the right by-line.
Graham Carey sends in a cross, Foul by Steven Thompson on Jamie MacDonald, free kick awarded. Jamie MacDonald takes the direct free kick.
Centre by Nigel Hasselbaink, clearance by Andy Webster.
Craig Beattie takes a shot. Marc McAusland gets a block in.
Craig Beattie gives away a free kick for an unfair challenge on Jim Goodwin. Graham Carey takes the direct free kick.
David van Zanten has an effort at goal from outside the area which misses left.
Graham Carey challenges Craig Beattie unfairly and gives away a free kick. Ian Black delivers the ball from the free kick right-footed from right wing, Lee Mair makes a clearance.
David van Zanten produces a cross, clearance by Andy Webster. Corner taken by Graham Carey from the left by-line to the near post.
Gary Teale is ruled offside. Jamie MacDonald restarts play with the free kick.
The assistant referee flags for offside against Rudi Skacel. Craig Samson takes the free kick.
Centre by Jamie Hamill, save made by Craig Samson.
The ball is sent over by David van Zanten, clearance by Ryan McGowan.
Rudi Skacel fouled by Lee Mair, the ref awards a free kick. Andy Webster restarts play with the free kick.
Booking The referee books Marc McAusland for unsporting behaviour.
Rudi Skacel is flagged offside by the assistant referee. Craig Samson takes the indirect free kick.
The second half has started.
45:00 +1:04 Half time
Half Time The whistle is blown to end the first half.
The ball is sent over by Daniel Grainger, Jim Goodwin manages to make a clearance. Shot on goal by David van Zanten from just inside the area clears the crossbar.
David van Zanten delivers the ball.
Ian Black has an effort at goal from a long way out that goes wide left.
The ball is delivered by Jamie Hamill, Lee Mair makes a clearance.
Craig Beattie takes a shot. Save made by Craig Samson.
Hugh Murray handles the ball and concedes a free kick. Jamie MacDonald takes the free kick.
Outswinging corner taken by Graham Carey, clearance made by Marius Zaliukas.
Foul by Jim Goodwin on Ian Black, free kick awarded. Ian Black crosses the ball in from the free kick, clearance made by David van Zanten.
Booking Caution for Steven Thompson.
Unfair challenge on Daniel Grainger by Steven Thompson results in a free kick. Free kick taken by Daniel Grainger.
Centre by Graham Carey.
The ball is sent over by Steven Thompson, Ryan McGowan manages to make a clearance.
The ball is delivered by Gary Teale, Daniel Grainger manages to make a clearance.
David van Zanten gives away a free kick for an unfair challenge on Ian Black. Ian Black restarts play with the free kick.
Foul by Ian Black on Hugh Murray, free kick awarded. The free kick is swung in left-footed by Graham Carey, Marius Zaliukas makes a clearance.
The assist for the goal came from Andrew Driver.
30:32 Goal scored
Goal - Jamie Hamill - St Mirren 0 - 1 Hearts Jamie Hamill finds the net with a goal from long distance to the bottom left corner of the goal. St Mirren 0-1 Hearts.
Booking Darren Barr receives a yellow card.
Steven Thompson fouled by Marius Zaliukas, the ref awards a free kick. Lee Mair takes the direct free kick.
Jim Goodwin concedes a free kick for a foul on Craig Beattie. Ryan McGowan takes the direct free kick.
Darren Barr gives away a free kick for an unfair challenge on Steven Thompson. Free kick taken by Marc McAusland.
The ball is sent over by Hugh Murray, Steven Thomson takes a shot. Save made by Jamie MacDonald.
Jim Goodwin crosses the ball. Marc McAusland takes a shot.
A cross is delivered by Steven Thompson, Marius Zaliukas gets a block in. Short corner taken by Graham Carey from the right by-line.
Shot from outside the box by Rudi Skacel misses to the left of the target.
Jamie Hamill takes the chance to get an effort at goal and bounces off the post.
Jim Goodwin challenges Craig Beattie unfairly and gives away a free kick. Free kick taken by Andy Webster.
Andrew Driver delivers the ball, clearance by Craig Samson.
Unfair challenge on Marc McAusland by Andrew Driver results in a free kick. Jim Goodwin takes the direct free kick.
Free kick awarded for a foul by Steven Thompson on Marius Zaliukas. Free kick taken by Marius Zaliukas.
Shot by Jim Goodwin from a long way out goes over the net.
David van Zanten produces a cross.
Booking Nigel Hasselbaink goes into the book for unsporting behaviour.
Nigel Hasselbaink concedes a free kick for a foul on Jamie Hamill. Andy Webster takes the free kick.
Gary Teale produces a right-footed shot from just outside the area that goes wide left of the goal.
Inswinging corner taken right-footed by Graham Carey, Gary Teale decides to take a short corner. Ryan McGowan manages to make a clearance.
A save by Jamie MacDonald from penalty by Graham Carey. St Mirren 0-0 Hearts.
Booking The referee shows Marius Zaliukas a yellow card.
Graham Carey produces a cross. Handball by Marius Zaliukas.
Centre by Steven Thompson, save made by Jamie MacDonald.
Marc McAusland takes a shot. Jamie MacDonald makes a save.
Graham Carey delivers the ball, Ryan McGowan gets a block in. Outswinging corner taken left-footed by Graham Carey from the left by-line, clearance made by Marius Zaliukas.
Centre by Graham Carey, save by Jamie MacDonald. Inswinging corner taken from the right by-line by Graham Carey, Ryan McGowan makes a clearance.
The offside flag is raised against Gary Teale. Direct free kick taken by Andy Webster.
Unfair challenge on Jim Goodwin by Rudi Skacel results in a free kick. Marc McAusland restarts play with the free kick.
The ball is swung over by David van Zanten, Headed effort from inside the area by Steven Thompson misses to the left of the goal.
Effort from inside the area by Rudi Skacel misses to the left of the goal.
The ball is sent over by Steven Thomson, Marius Zaliukas manages to make a clearance.
The ref blows the whistle to begin the match.
Live text and data provided by The Press Association
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.