Liam Craig's late header ensured St Johnstone will finish in the Scottish Premier League's top six as Dundee United were denied victory in Perth.
Teenager Ryan Gauld's first senior goal, a low shot from the edge of the penalty area, edged United in front.
But the visitors were reduced to 10 men in the second half when Stuart Armstrong received a second booking.
Saints pressed for a leveller and were rewarded when Craig netted in the third minute of injury time.
The result also guarantees Ross County a top-half place when the division splits in two later this month.
United, who were without winger Gary Mackay-Steven after he picked up an injury on international duty with Scotland, enjoyed the bulk of possession early on without seriously threatening.
And it was Saints who created the first meaningful chance when Craig's corner was headed narrowly over by Murray Davidson.
But Craig was caught in possession by Mark Millar moments later and 17-year-old Gauld got a vital touch on the eventual through ball to nudge it past Alan Mannus into the net.
Steven MacLean's near-post flick from a corner did not have the beating of Radoslaw Cierzniak and Craig's free-kick drifted over as the hosts pressed before the break.
St Johnstone were restricted to long-range efforts for a period in the second half but one such strike by Craig required a superb save from Cierzniak.
The pressure on the United goal was growing and Barry Douglas nodded a Davidson header off the line before MacLean's looping headed effort was tipped onto the post by the Polish keeper.
Armstrong, who had earlier been cautioned for a foul on Gregory Tade, was dismissed when referee Iain Brines judged the midfielder to have dived in the box and produced a yellow and then a red card.
Cierzniak made another telling save from Davidson's low shot and any hope of a Saints comeback looked forlorn when MacLean blazed over from a promising position.
But substitute Mehdi Abeid picked out Craig from a corner and this time the effort beat Cierzniak.
United now require other results to go their way if they are to claim a top-six place. Jackie McNamara's men are level on points with seventh-place Aberdeen ahead of the meeting of those two sides on Saturday.
However Kilmarnock, who also sit on 41 points, have a game in hand against St Mirren on Wednesday before the final round of pre-split fixtures.
Live Text Commentary
Full Time The game is over, as the referee blows his whistle.90:00 +4:15
Barry Douglas takes the free kick.90:00 +4:15 Booking
Booking Mark Millar is cautioned.90:00 +4:07 Booking
Booking Booking for Murray Davidson for unsporting behaviour.90:00 +3:47
Mark Millar fouled by Murray Davidson, the ref awards a free kick.90:00 +2:03
Mehdi Abeid provided the assist for the goal.90:00 +2:03 Goal scored
Goal! - Liam Craig - St J'stone 1 - 1 Dundee U Liam Craig finds the back of the net with a headed goal from close in. St Johnstone 1-1 Dundee Utd.90:00 +1:51
Corner taken right-footed by Mehdi Abeid,90:00 +1:36
Mehdi Abeid takes a shot.89:52
Steven MacLean produces a right-footed shot from inside the area that clears the crossbar.87:58
Shot by Gwion Edwards from deep inside the penalty area misses to the right of the target.87:21
David MacKay takes the direct free kick.87:21 Substitution
Substitution Mehdi Abeid comes on in place of Thomas Scobbie.87:21
Sean Dillon challenges Nigel Hasselbaink unfairly and gives away a free kick.85:36
David MacKay challenges Ryan Dow unfairly and gives away a free kick. Barry Douglas takes the direct free kick.84:10
Murray Davidson takes a shot. Save made by Radoslaw Cierzniak.82:32
The ball is crossed by David MacKay, John Souttar makes a clearance.78:16 Substitution
Substitution Gwion Edwards on for Rowan Vine.78:16 Dismissal
Dismissal Stuart Armstrong is sent off by the referee for second bookable offence.77:10
Indirect free kick taken by John Souttar.
Booking Liam Craig is booked.77:03
Free kick awarded for a foul by Liam Craig on Stuart Armstrong.75:47 Substitution
Substitution John Souttar comes on in place of Brian McLean.75:47 Substitution
Substitution Ryan Dow joins the action as a substitute, replacing Michael Gardyne.75:47 Substitution
Substitution (Dundee Utd) makes a substitution, with Richie Ryan coming on for Ryan Gauld.75:15
Inswinging corner taken by Rowan Vine, Murray Davidson has a header from close in and clears the crossbar.72:36
Nigel Hasselbaink concedes a free kick for a foul on Barry Douglas. Barry Douglas restarts play with the free kick.71:48
Thomas Scobbie delivers the ball, save by Radoslaw Cierzniak.70:26
Inswinging corner taken from the right by-line by Barry Douglas, clearance by Thomas Scobbie.69:42
Willo Flood fouled by Frazer Wright, the ref awards a free kick. Barry Douglas takes the free kick.69:05
Corner taken left-footed by Liam Craig from the right by-line, Mark Millar makes a clearance.68:04
Nigel Hasselbaink takes a shot. Comfortable save by Radoslaw Cierzniak.66:10
Michael Gardyne delivers the ball, Frazer Wright manages to make a clearance.62:42
Steven MacLean takes a shot. Brian McLean gets a block in.61:23 Substitution
Substitution Nigel Hasselbaink replaces Gregory Tade.60:59
Steven MacLean takes a shot. Save by Radoslaw Cierzniak.60:14
Liam Craig takes a shot. Radoslaw Cierzniak makes a save. Inswinging corner taken left-footed by Liam Craig from the right by-line, Murray Davidson takes a shot. Keith Watson makes a clearance.59:49
Murray Davidson has an effort at goal from just outside the box which goes wide of the right-hand post.59:03
Jon Daly is caught offside. Alan Mannus takes the indirect free kick.57:35
Effort on goal by Stuart Armstrong from just inside the penalty box goes harmlessly over the target.57:07
Chris Millar takes a shot. Comfortable save by Radoslaw Cierzniak.56:02
Murray Davidson fouled by Michael Gardyne, the ref awards a free kick. Liam Craig takes the indirect free kick.55:42
Unfair challenge on Michael Gardyne by Chris Millar results in a free kick. Michael Gardyne takes the free kick.54:52
Shot from outside the box by Gregory Tade misses to the left of the goal.54:20
Free kick awarded for a foul by Chris Millar on Ryan Gauld. Willo Flood restarts play with the free kick.52:10
A cross is delivered by Michael Gardyne, clearance made by Steven Anderson.47:58
Gregory Tade is ruled offside. Indirect free kick taken by Radoslaw Cierzniak.47:08
A cross is delivered by Keith Watson, save by Alan Mannus.46:28
Rowan Vine delivers the ball, blocked by Barry Douglas. Short corner worked by Rowan Vine.45:01
The referee gets the second half underway.45:00 +0:12 Half time
Half Time The ref blows to signal half-time.44:57
Liam Craig takes a shot. Brian McLean gets a block in.43:15
Rowan Vine fouled by Mark Millar, the ref awards a free kick. Liam Craig crosses the ball from the free kick left-footed from right wing.40:03
Foul by Stuart Armstrong on Gregory Tade, free kick awarded. Liam Craig has a direct shot on goal from the free kick.38:09
Free kick awarded for a foul by Chris Millar on Michael Gardyne. Mark Millar produces a shot on goal direct from the free kick.37:10
Jon Daly concedes a free kick for a foul on Frazer Wright. Free kick taken by Chris Millar.36:45
Rowan Vine produces a left-footed shot from just outside the area that goes harmlessly over the bar.36:18
Unfair challenge on Steven Anderson by Jon Daly results in a free kick. Frazer Wright takes the indirect free kick.35:17
Corner taken by Rowan Vine from the left by-line.34:43
Inswinging corner taken by Rowan Vine.33:44
Steven MacLean concedes a free kick for a foul on Barry Douglas. Indirect free kick taken by Radoslaw Cierzniak.33:13
Free kick awarded for an unfair challenge on Murray Davidson by Stuart Armstrong. Free kick taken by Alan Mannus.30:47
Unfair challenge on Ryan Gauld by Thomas Scobbie results in a free kick. Indirect free kick taken by Willo Flood.24:40
Free kick awarded for an unfair challenge on Gregory Tade by Willo Flood. David MacKay shoots direct from the free kick.23:17
Assist by Mark Millar.23:17 Goal scored
Goal! - Ryan Gauld - St J'stone 0 - 1 Dundee U Ryan Gauld grabs a goal from the edge of the penalty area low into the middle of the goal. St Johnstone 0-1 Dundee Utd.19:50
Willo Flood concedes a free kick for a foul on Murray Davidson. Liam Craig restarts play with the free kick.16:24
David MacKay produces a cross, save made by Radoslaw Cierzniak.14:50
The ball is crossed by Barry Douglas, Liam Craig makes a clearance. Corner taken by Willo Flood from the left by-line, clearance made by Thomas Scobbie.13:06
Corner taken by Liam Craig, Murray Davidson has a headed effort from close range and clears the bar.11:12
Ryan Gauld produces a left-footed shot from just outside the box that misses to the right of the net.7:45
Direct free kick taken by David MacKay.7:45 Booking
Booking Stuart Armstrong receives a yellow card for unsporting behaviour.7:40
Free kick awarded for an unfair challenge on Gregory Tade by Stuart Armstrong.4:52
Free kick awarded for an unfair challenge on Murray Davidson by Barry Douglas. Free kick taken by David MacKay.3:22
Keith Watson has a header from close in and clears the crossbar.1:05
Free kick awarded for an unfair challenge on Steven MacLean by Stuart Armstrong. Steven MacLean takes the free kick.0:00
The referee gets the match started.
Live data and text provided by our data suppliers