Hearts gave their hopes of playing European football a major boost with a convincing Scottish Premier League win over sixth-placed St Johnstone.
Midfielder Rudi Skacel provided a cool finish to Ryan McGowan's cutback to open the scoring after 21 minutes.
Callum Davidson had a drive tipped over by home keeper Mark Ridgers and his team-mate Cillian Sheridan shot wide.
But Andy Webster slid in Hearts' second after the break and his fellow defender Marius Zaliukas hit the post.
The result means Hearts are now in fifth place, two points ahead of the Perth side with a match to play.
A Scottish Cup win against Hibernian in two weeks' time, though, would mean one preliminary round fewer for Hearts to negotiate than making the Europa League qualifiers through their league placing.
Hearts were first to register an attack of note when, in the sixth minute, Andy Driver showed a glimpse of the form that once excited international managers on either side of the Scotland-England border.
He shimmied his way through the Saints defence, cut inside and smacked a near-post shot that Alan Mannus had to be sharp to save.
Sheridan headed a few feet wide when he leapt higher than the Hearts defence, with home keeper Ridgers flapping at fresh air.
The breakthrough came when Czech Republic midfielder Skacel scored his 16th of the season by finishing off a fine McGowan run and cutback with a confident first-time slap of his left boot.
A few minutes later a Danny Grainger corner was headed at goal by Webster, Mannus made the save and Skacel blasted the rebound into the stand when many would have fancied him to bury it.
St Johnstone found some respite as the half progressed and it took Hearts midfielder Ian Black to make a block on the goalline when Steven Anderson's downward header was diverted towards the net by Murray Davidson.
Buoyed by setting up Hearts' opener, McGowan pestered the Saints defence again when he got forward to take Black's pass but knocked the ball wide instead of cutting the ball back once more.
And Zaliukas squandered a glorious chance to make it 2-0 when he raced on to Black's corner but knocked the ball wide with his face when a header on target would have been hard to stop.
As an entertaining first half swung to the other end, Callum Davidson's drive was tipped over by Ridgers.
After the break Ridgers caused a moment of panic when he parried an excellent Jody Morris drive into the air before catching it just before it crossed the line.
Hearts moved two in front in 57 minutes when a typically accurate in-swinging Grainger delivery was prodded home by Webster who had evaded his marker.
Soon after, Zaliukas did connect properly with a Black corner and was unlucky to see it bounce off the post.
Former Hibernian favourite Derek Riordan was given a hot reception when he replaced Saints midfielder Chris Millar and it was not long before he showed his value to his new team.
Riordan's corner from the left provided Sheridan with a chance to nod home and as the ball bobbled around he had a shot deflected for another of his corners, which should have been headed home by Marcus Haber.
But Hearts looked the stronger team over the piece and were worthy winners.
Scott Robinson challenges Alan Maybury unfairly and gives away a free kick. Alan Maybury delivers the ball from the free kick left-footed from right channel, Scott Robinson makes a clearance.
Derek Riordan has a shot on goal from outside the box which misses left.
Outswinging corner taken by Ian Black.
Substitution Gordon Smith on for Suso Santana.
Unfair challenge on Suso Santana by Alan Maybury results in a free kick. The free kick is delivered right-footed by Suso Santana from right channel, clearance by David MacKay.
Substitution (Hearts) makes a substitution, with Mehdi Taouil coming on for Stephen Elliott.
Marius Zaliukas produces a right-footed shot from just outside the box that goes wide right of the target.
Free kick awarded for an unfair challenge on Daniel Grainger by Cillian Sheridan. Daniel Grainger takes the direct free kick.
Unfair challenge on Alan Maybury by Suso Santana results in a free kick. Liam Craig takes the free kick.
Substitution Callum Davidson goes off and Alan Maybury comes on.
Rudi Skacel produces a right-footed shot from just outside the box that misses to the right of the net.
Free kick awarded for a foul by Derek Riordan on Ryan McGowan. Free kick taken by Andy Webster.
Effort on goal by Derek Riordan from inside the penalty area goes harmlessly over the bar.
The assistant referee signals for offside against Andrew Driver. Alan Mannus takes the direct free kick.
The referee blows for offside. Alan Mannus takes the direct free kick.
Booking Booking for Daniel Grainger for dissent.
Marcus Haber concedes a free kick for a foul on Suso Santana. Ryan McGowan takes the direct free kick.
Inswinging corner taken by Derek Riordan from the left by-line, Headed effort from deep inside the penalty area by Marcus Haber misses to the left of the goal.
Derek Riordan takes the inswinging corner, clearance made by Ryan McGowan.
Inswinging corner taken by Liam Craig.
Free kick taken by Andy Webster.
Booking The referee books Callum Davidson for unsporting behaviour.
Unfair challenge on Suso Santana by Callum Davidson results in a free kick.
Rudi Skacel takes a shot from just inside the penalty box which clears the crossbar.
Substitution Jamie Adams on for Murray Davidson.
Substitution (St Johnstone) makes a substitution, with Derek Riordan coming on for Chris Millar.
Corner taken by Ian Black, Marius Zaliukas produces a header from deep inside the area and hits the post.
The assist for the goal came from Daniel Grainger.
57:19 Goal scored
Goal! - Andy Webster - Hearts 2 - 0 St J'stone A goal is scored by Andy Webster from inside the penalty area to the bottom left corner of the goal. Hearts 2-0 St Johnstone.
The ball is crossed by Daniel Grainger,
Booking Jody Morris receives a caution for unsporting behaviour.
Free kick awarded for a foul by Jody Morris on Suso Santana.
Suso Santana is adjudged to have handled the ball. Alan Mannus restarts play with the free kick.
Substitution Scott Robinson joins the action as a substitute, replacing Darren Barr.
Ian Black has shot on goal from just outside the box which goes wide of the right-hand upright.
The referee blows for offside against Marcus Haber. Mark Ridgers takes the free kick.
Free kick awarded for an unfair challenge on Chris Millar by Daniel Grainger. The free kick is delivered left-footed by Liam Craig from own half, Daniel Grainger fouled by Steven Anderson, the ref awards a free kick. Mark Ridgers takes the free kick.
Jody Morris challenges Andrew Driver unfairly and gives away a free kick. Free kick taken by Daniel Grainger.
The second half has started.
45:00 +1:07 Half time
Half Time The referee blows for half time.
Free kick awarded for a foul by Murray Davidson on Andy Webster. Free kick taken by Mark Ridgers.
Corner taken left-footed by Liam Craig.
The assistant referee signals for offside against Stephen Elliott. Cillian Sheridan restarts play with the free kick.
Murray Davidson challenges Stephen Elliott unfairly and gives away a free kick. Daniel Grainger restarts play with the free kick.
Corner taken right-footed by Ian Black, Marius Zaliukas has a headed effort at goal from deep inside the area missing to the left of the target.
The referee blows for offside. Mark Ridgers restarts play with the free kick.
Unfair challenge on Marcus Haber by Ian Black results in a free kick. David MacKay takes the direct free kick.
Ryan McGowan concedes a free kick for a foul on Liam Craig. Liam Craig takes the direct free kick.
Free kick awarded for an unfair challenge on Jody Morris by Rudi Skacel. Steven Anderson takes the free kick.
Corner from the right by-line taken by Liam Craig, Steven Anderson takes a shot. Blocked by Ian Black.
Stephen Elliott is flagged offside by the assistant referee. Alan Mannus takes the free kick.
Corner taken left-footed by Marius Zaliukas, Andy Webster takes a shot. Save by Alan Mannus. Header from deep inside the area by Daniel Grainger goes over the bar.
Inswinging corner taken from the right by-line by Daniel Grainger.
The assist for the goal came from Ryan McGowan.
20:57 Goal scored
Goal! - Rudi Skacel - Hearts 1 - 0 St J'stone Rudi Skacel fires in a goal from inside the area to the top left corner of the goal. Hearts 1-0 St Johnstone.
Outswinging corner taken from the right by-line by Ian Black.
Free kick awarded for a foul by Stephen Elliott on Steven Anderson. Direct free kick taken by David MacKay, Headed effort from deep inside the area by Cillian Sheridan misses to the left of the goal.
Free kick awarded for an unfair challenge on Steven Anderson by Andrew Driver. Direct free kick taken by Murray Davidson.
Free kick awarded for an unfair challenge on Andrew Driver by Liam Craig.
Rudi Skacel shoots direct from the free kick.
Booking Liam Craig booked for unsporting behaviour.
Foul by Stephen Elliott on Alan Mannus, free kick awarded. Direct free kick taken by Alan Mannus.
Corner from left by-line taken by Ian Black.
Marius Zaliukas has an effort at goal from outside the box which goes wide right of the goal.
Foul by Callum Davidson on Suso Santana, free kick awarded. Daniel Grainger takes the direct free kick.
David McCracken takes a shot. Ryan McGowan gets a block in.
Rudi Skacel takes a shot.
Free kick awarded for a foul by Steven Anderson on Rudi Skacel. Direct free kick taken by Ian Black.
The assistant referee flags for offside against Cillian Sheridan. Indirect free kick taken by Mark Ridgers.
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.