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.
Heart of Midlothian
- 28 Ridgers
- 03 Grainger Booked
- 05 Barr (Robinson - 55' )
- 06 Webster
- 17 McGowan
- 26 Zaliukas
- 07 Santana (Smith - 89' )
- 08 Black
- 11 Driver
- 19 Skacel
- 10 Elliott (Taouil - 84' )
- 53 Hamilton
- 12 Templeton
- 21 Taouil
- 35 Prychynenko
- 18 Novikovas
- 22 Smith
- 27 Robinson
- 15 Mannus
- 02 MacKay
- 03 Davidson Booked (Maybury - 78' )
- 06 Anderson
- 18 McCracken
- 04 Morris Booked
- 07 Millar (Riordan - 61' )
- 08 Davidson (Adams - 62' )
- 10 Craig Booked
- 11 Sheridan
- 23 Haber
- 01 Enckelman
- 12 Maybury
- 20 Adams
- 39 Gray
- 22 Oyenuga
- 46 Keatings
- 47 Riordan
Live Text Commentary
Full Time The referee brings the game to a close.90:00 +1:21
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.89:53
Derek Riordan has a shot on goal from outside the box which misses left.88:34
Outswinging corner taken by Ian Black.88:34 Substitution
Substitution Gordon Smith on for Suso Santana.87:14
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.83:18 Substitution
Substitution (Hearts) makes a substitution, with Mehdi Taouil coming on for Stephen Elliott.81:42
Marius Zaliukas produces a right-footed shot from just outside the box that goes wide right of the target.79:28
Free kick awarded for an unfair challenge on Daniel Grainger by Cillian Sheridan. Daniel Grainger takes the direct free kick.78:57
Unfair challenge on Alan Maybury by Suso Santana results in a free kick. Liam Craig takes the free kick.77:53 Substitution
Substitution Callum Davidson goes off and Alan Maybury comes on.77:44
Rudi Skacel produces a right-footed shot from just outside the box that misses to the right of the net.77:04
Free kick awarded for a foul by Derek Riordan on Ryan McGowan. Free kick taken by Andy Webster.76:25
Effort on goal by Derek Riordan from inside the penalty area goes harmlessly over the bar.75:52
The assistant referee signals for offside against Andrew Driver. Alan Mannus takes the direct free kick.72:16
The referee blows for offside. Alan Mannus takes the direct free kick.70:54 Booking
Booking Booking for Daniel Grainger for dissent.70:36
Marcus Haber concedes a free kick for a foul on Suso Santana. Ryan McGowan takes the direct free kick.69:22
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.68:43
Derek Riordan takes the inswinging corner, clearance made by Ryan McGowan.
Inswinging corner taken by Liam Craig.66:52
Free kick taken by Andy Webster.66:52 Booking
Booking The referee books Callum Davidson for unsporting behaviour.66:34
Unfair challenge on Suso Santana by Callum Davidson results in a free kick.66:03
Rudi Skacel takes a shot from just inside the penalty box which clears the crossbar.60:43 Substitution
Substitution Jamie Adams on for Murray Davidson.60:43 Substitution
Substitution (St Johnstone) makes a substitution, with Derek Riordan coming on for Chris Millar.59:36
Corner taken by Ian Black, Marius Zaliukas produces a header from deep inside the area and hits the post.57:19
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.56:39
The ball is crossed by Daniel Grainger,56:39 Booking
Booking Jody Morris receives a caution for unsporting behaviour.56:16
Free kick awarded for a foul by Jody Morris on Suso Santana.55:34
Suso Santana is adjudged to have handled the ball. Alan Mannus restarts play with the free kick.54:08 Substitution
Substitution Scott Robinson joins the action as a substitute, replacing Darren Barr.54:02
Ian Black has shot on goal from just outside the box which goes wide of the right-hand upright.52:18
The referee blows for offside against Marcus Haber. Mark Ridgers takes the free kick.47:38
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.45:31
Jody Morris challenges Andrew Driver unfairly and gives away a free kick. Free kick taken by Daniel Grainger.45:01
The second half has started.45:00 +1:07 Half time
Half Time The referee blows for half time.43:36
Free kick awarded for a foul by Murray Davidson on Andy Webster. Free kick taken by Mark Ridgers.41:54
Corner taken left-footed by Liam Craig.41:11
The assistant referee signals for offside against Stephen Elliott. Cillian Sheridan restarts play with the free kick.40:09
Murray Davidson challenges Stephen Elliott unfairly and gives away a free kick. Daniel Grainger restarts play with the free kick.38:30
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.37:39
The referee blows for offside. Mark Ridgers restarts play with the free kick.37:00
Unfair challenge on Marcus Haber by Ian Black results in a free kick. David MacKay takes the direct free kick.35:21
Ryan McGowan concedes a free kick for a foul on Liam Craig. Liam Craig takes the direct free kick.30:02
Free kick awarded for an unfair challenge on Jody Morris by Rudi Skacel. Steven Anderson takes the free kick.29:17
Corner from the right by-line taken by Liam Craig, Steven Anderson takes a shot. Blocked by Ian Black.25:54
Stephen Elliott is flagged offside by the assistant referee. Alan Mannus takes the free kick.23:46
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.22:59
Inswinging corner taken from the right by-line by Daniel Grainger.20:57
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.16:36
Outswinging corner taken from the right by-line by Ian Black.15:23
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.13:48
Free kick awarded for an unfair challenge on Steven Anderson by Andrew Driver. Direct free kick taken by Murray Davidson.11:31
Free kick awarded for an unfair challenge on Andrew Driver by Liam Craig.11:27
Rudi Skacel shoots direct from the free kick.11:27 Booking
Booking Liam Craig booked for unsporting behaviour.9:08
Foul by Stephen Elliott on Alan Mannus, free kick awarded. Direct free kick taken by Alan Mannus.8:16
Corner from left by-line taken by Ian Black.7:25
Marius Zaliukas has an effort at goal from outside the box which goes wide right of the goal.6:13
Foul by Callum Davidson on Suso Santana, free kick awarded. Daniel Grainger takes the direct free kick.4:59
David McCracken takes a shot. Ryan McGowan gets a block in.2:57
Rudi Skacel takes a shot.2:19
Free kick awarded for a foul by Steven Anderson on Rudi Skacel. Direct free kick taken by Ian Black.0:35
The assistant referee flags for offside against Cillian Sheridan. Indirect free kick taken by Mark Ridgers.0:00
The referee starts the match.
Live data and text provided by our data suppliers