They got there in the end. A European tie which began in baking early-evening heat finished in darkness at 10.24pm, with a penalty by Tam Scobie which lit up McDiarmid Park. They beat FC Lucerne after a 1-1 draw and then a flawless penalty shoot-out.
Stevie MacLean, Liam Caddis, Dave Mackay, Stevie May and Scobbie buried all five of their kicks, which meant that Alan Mannus's save from Marco Schneuwly was decisive. A year ago, St Johnstone had cursed themselves after going out of Europe on penalties to FC Minsk. This year time their efforts were impeccable.
Next Thursday they will take on Spartak Trnava of Slovakia in the first leg of the Europa League third qualifying round. It surely will not be as tight as this. May had put them ahead in the first half - building on their fine 1-1 draw last week in Switzerland - but Lucerne cancelled it out and plunged Perth into a night riddled with anxiety.
At one stage, in extra-time, manager Tommy Wright was embroiled in a heated exchange with one of the Lucerne backroom staff. At the end, he was helping police and stewards clear the pitch after an invasion by a couple of hundred home fans.
St Johnstone have developed an odd, infuriating, habit in Europe: they build the foundations for victory with fine away legs and are then erratic when it comes to finishing the job in second legs at McDiarmid Park. Against Rosenborg a year ago they won in Norway but then drew in Perth, a great but nervy triumph. Then against FC Minsk they won in Belarus only to lose at home and go out on penalties to a poor opponent. Here, again, a scoring draw in Lucerne last week was a terrific platform but after an hour at home it had been deservedly wiped away by their Swiss opponents.
From then on it was always a sweaty, knife-edge tie, littered with little errors and carelessness. St Johnstone never really looked sure of themselves against a capable opponent.
They were not good enough with the ball and their decision making was poor. If Lucerne could finish, the tie would never have gone to a shoot-out in the first place.
McDiarmid Park had been resplendent. The attendance was given as 8486. It was the home support's first proper chance to again see, and enjoy, the team that brought the Scottish Cup to Perth in May. The visuals were more impressive than the audio.
They took a while to loosen their vocal chords, and never really let their reserve go, but the atmosphere remained charged for most of the evening thanks to the terrific, 600-strong, drum and flag-wielding Lucerne support. St Johnstone's early opening goal muffled the travellers for a while, but not long. Soon they were bellowing out their incomprehensible songs as loud as ever.
In Switzerland, St Johnstone had shown that they do have it in them to be more than a one-man team. They nabbed a precious away goal there, and a draw, without May. The thigh strain he suffered in a friendly against East Fife ruled him out but cleared in time for last night.
Normal service was quickly resumed. The hosts had endured 23 pretty strained, difficult minutes, with Lucerne looking brighter than them, when suddenly Belgian referee Jonathan Lardot was pointing at the spot to give them a penalty. Xavier Hochstrasser had been pulling Gary Miller's shirt while a David Wotherspoon corner was looping its way into the penalty area, and Lardot impressively picked up on the offence.
May lined up in front of the Ormond Stand, packed with home supporters, and delivered for them yet again by thrashing his penalty high into the net. Generally May looked short of match fitness, understandably enough, and overall Lucerne often looked the more capable side. It was hard on them that they fell behind and they more than deserved the equaliser they carved out after an hour. Wright's defenders made a mess of clearing an attack in their penalty area despite having plenty of bodies around, and inevitably the ball broke for Marco Schneuwly to bury a low shot in the corner of the net. The substitute had scored Lucerne's goal in the first leg, too. St Johnstone's comfort zone had been swiped away.
An away goal would have killed them and Lucerne had a handful of potshots to frighten the jittery home crowd. By the time the match slithered into extra time it really wasn't much to look at. The play was bitty and patchy. Dario Lezcano sliced a shot well wide when St Johnstone were exposed.
In the dying seconds, Lee Croft fired a cross from the right and a goal beckoned for Caddis, who somehow smacked a shot on to the outside of the woodwork.
When it came to the penalties, though, Caddis and his team-mates were beyond reproach.