Rowan Vine's scrambled goal consolidated St Johnstone's position in the top half of the Clydesdale Bank Premier League as they won 1-0 and delivered a major blow to St Mirren's chances of joining them.
Vine shot home from close range early in the second half after Murray Davidson had bundled the ball towards goal from Mehdi Abeid's corner in a strike which resembled a similarly scrappy first 45 minutes on a bumpy McDiarmid Park pitch.
The home side built on the goal and hit the woodwork three times with home goalkeeper Alan Mannus not seriously troubled in the second half.
They moved into fourth place, level on 40 points with Motherwell, while St Mirren are now eight points adrift of the top six with half a dozen games left until the split.
Danny Lennon's side, who had John McGinn back in the line-up for Graham Carey, started brightly with Esmael Goncalves making some dangerous runs after peeling off to the right but it was the hosts who created the early chances.
David McCracken headed over Liam Craig's free-kick and Vine got a set-piece on target but Craig Samson was well-placed.
St Mirren's first effort saw Conor Newton's low strike parried away by Mannus, who then handed Steven Thompson a chance when he chested the ball out on the cusp of the 18-yard line as Goncalves chased a long ball. However, Thompson was too high with his attempted lob.
Craig fired just wide after a one-two with Vine, but earned a corner AS the shot nicked off a defender. The delivery eventually fell for Abeid 16 yards out and the on-loan Newcastle midfielder - facing St James' Park team-mates Paul Dummett and Newton - volleyed over with his left foot.
Vine was booked for a dive when he threw himself to the ground clutching his leg as David van Zanten jockeyed him in the box, getting up as soon as referee Steven McLean flashed the yellow card.
Goncalves almost got away in the opening stages of the second half but Frazer Wright got back well and the Perth club took the lead in the 52nd minute.
No St Mirren defender reacted quickly enough when Abeid's corner bounced in the six-yard box and Davidson drove in to force the ball towards the goal with Vine making sure on the goal-line as he fired the ball into the back of the net.
Steve Lomas' side kept up the pressure and Wright headed off the top of the bar following Davidson's cross.
Substitute Gregory Tade shot wide of the far post after a promising break, although Vine's cross forced him out wide.
Home striker Steven MacLean then headed into Samson's arms after Cregg had headed the ball into the six-yard box, and the same player soon volleyed a corner wide in what was a difficult chance.
St Mirren had some pressure but their final delivery often let them down and the ball would not fall for them in the box.
And St Johnstone almost doubled their lead with five minutes left when Tade twice hit the woodwork with headers from Craig deliveries.