IT all seemed to be heading toward an inescapable conclusion.
Coasting by a margin of 3-1 and with just 120 seconds left on the clock, St Johnstone were home and hosed, the three points firmly secured and locked down against a callow Hearts team battling upstream for top-flight survival.
But perhaps it was the youthful vigour of Gary Locke's sappers, that refusal to know when you are beaten, which lit the spark for a quite extraordinary comeback at McDiarmid Park.
The key moment - and it was a long one - came in the final, crazy minute of normal time. Hearts, who had been the inferior team by miles even with an extra-man advantage, grabbed hold of a slender lifeline when Sam Nicholson bundled the ball over Alan Mannus's goal-line to get within a single strike of their hosts.
That was the cue for bedlam to break out as the visitors fought to pick up the ball and hurry it back to the halfway line. Mannus and Hearts' Ryan Stevenson were both sent off in a wild stramash as a clutch of players were literally tangled up in the net, battling to either quicken or stop the restart.
But restart the game eventually did, and after Callum Paterson hit the bar in a manic stoppage-time sequence, Jamie Hamill's corner was thumped into the net by Danny Wilson past Tam Scobbie, who had been forced to pull on the gloves as there was no substitute left to replace Mannus. The ball this time was retrieved by the bizarre, comedy-gold presence of Jamie MacDonald, the Hearts goalkeeper having run the length of the park to celebrate. It finished like that, though, at three goals apiece.
"I can't be prouder of our players," said Locke. "You've seen the spirit we've got, it's a young team, but they never give up."
For all Hearts deserve huge credit for their fightback, referee Brian Colvin had a nightmare afternoon, and St Johnstone awoke from it after 90 thrilling minutes in a cold sweat wondering how it could possibly have all gone wrong. Stevie May scored a hat-trick - he was a magnificent, thunderous presence in attack - but somehow was not on a winning side.
Throughout, it appeared the hosts had far too much grit and quality for their young visitors, even playing for the majority with 10 men. The sending-off came after Gary McDonald played an awful back pass into the path of the lurking Dale Carrick, who skipped past Steven Anderson who promptly brought him down.
While the defender was the closest man to his own keeper, the Hearts striker was 40 yards out and heading away from goal. Even so, the referee deemed it a red card, despite the close, covering presence of Frazer Wright.
Still, St Johnstone should have won. May scored two penalties, and in between got another straight after half-time. Nigel Hasselbaink played a lovely through ball for the striker to gallop on to; his touch was perfect and although his shot was less so, May carried on right past MacDonald's save, driving the ball in through force of will and muscle. His other two came from the spot. The second penalty of the day arrived not long after Carrick - with his first Hearts goal - had pulled one back with a second-half header.
It was May again who flicked the ball up past Kevin McHattie, who had his arms raised when the ball brushed against them. The striker, of course, scored his third from the spot to seemingly crush visiting hopes. The first had been given after the ball was played into Hasselbaink by Dave Mackay, and the Dutchman spun past McHattie, who had a tug at his jersey. May despatched the penalty, but his treble was not to be decisive. For all that Hearts will almost certainly be relegated - even this snaffled point means little at the end of the day - it bodes well for next season, when they will likely never have to deal with a striker like May.
"I'm disappointed to lose two points," said St Johnstone manager Tommy Wright. "We were by far the better team even with 10 men. We'll definitely be appealing Anderson's red card. We should be talking about how well we've played. Unfortunately we're not."