Moses Ebiye's 94th-minute header salvaged a Scottish Premiership victory for Motherwell in a stoppage-time period featuring superb saves, a goal and a red card.
Ebiye, standing on the goal-line, applied the killer touch to Dan Casey's back-post header, moments after Ross Sinclair had denied the defender with a flying stop.
St Johnstone defender Jack Sanders was then dismissed in the dying embers for a bruising body-check on substitute Tony Watt.
Motherwell had bossed proceedings for over an hour, before the tumultuous endgame, leading through Casey's 11th-minute header.
And they ought to have amassed more than a one-goal lead by the time the hosts showed signs of an attacking pulse.
After Paul McGinn was denied an early penalty following copious video replays, Casey seized upon Sinclair’s tentative attempt to clear a corner, allowing the defender to steam in and loop home.
Andy Halliday swerved an outrageous first-time piledriver beyond Sinclair soon after, but the goal was expunged with Tawanda Maswanhise offside when he squared for the midfielder.
Motherwell had their foot wedged on St Johnstone’s throat, prodigious teenager Lennon Miller’s influence growing and Watt threatening with lancing runs.
A second goal would have reflected their supremacy, but it never came. That proved painful.
Craig Levein made a triple substitution, and one of his new men, Makenzie Kirk, neatly played in Benjamin Kimpioka to blast home his seventh of the season.
That teed up a helter-skelter final quarter, with Watt seeing a scrappy finish correctly ruled out for a foul on Sinclair; Kirk going close from distance; and Ebiye then former Saint Liam Gordon drawing more rearguard action.
Come the frenetic finale, Ebiye struck, earning Motherwell back-to-back league victories and fourth spot in the table, while bumping St Johnstone down to eighth.
Toothless St Johnstone rue lack of dynamism
After “a couple of errors”, Levein opted to remove first-choice goalkeeper Josh Rae not just from the starting XI, but out of the matchday squad altogether.
Sinclair had not played in over a year as he battled back from an elbow injury, and perhaps unsurprisingly, had moments of uncertainty. To give him his due, he finished the game in inspired form, a trio of excellent stops just before the winner.
At the other end, St Johnstone wielded two adept strikers, but for an age they toiled to involve either Nicky Clark or Kimpioka where they could influence proceedings. Reasonable spells of possession, but little dynamism, verve or promise of an end product.
Levein’s substitutions changed the game, but in truth, a draw would have felt harsh on Motherwell.
Motherwell feelgood bubbles on
Manager Stuart Kettlewell and assistant Stevie Frail were confirmed to have signed new deals earlier on Saturday, and a third-straight win keeps the momentum rolling.
Kettlewell talks long and loud about the “non-negotiable” elements of Motherwell’s identity, and for the most part, those were present in shovelfuls.
McGinn remains brilliantly commanding at the back, Stephen O’Donnell is rejuvenated, and Maswanhise looks a pulse-quickening find.
Their football is all the more impressive considering the unenviable list of injured first-teamers.
Kettlewell would have been furious had his team squandered their winning position, but Ebiye’s salvo ensured the feelgood bubbles on.
A trip to unbeaten Aberdeen on 14 September is a tasty prospect.
What they said
St Johnstone manager Craig Levein: “We’d been working very hard on trying to do better with the ball and that side of things was good today.
“Ninety percent of our defending was good, but our defending from set-pieces was woeful. That’s why we didn’t get anything from the match.”
Motherwell manager Stuart Kettlewell: “What a way to win a game. You can see the emotions pouring out. It wasn’t plain sailing.
“We have scored a lot of last-minute goals through my time and that is a part of the togetherness, energy and drive to do as best as they can for the club.”