Roland Idowu scored a late penalty winner in St Mirren's 3-2 Premier League win over St Johnstone as they moved back into the top six.
Mark O'Hara's spot-kick was saved by Josh Rae but VAR alerted referee Euan Anderson that he had gone off his line early and – in the replay – Idowu, on loan from Shrewsbury, sent Rae the wrong way. get the maximum points.
The Paisley side had won just once and conceded two goals in 10 appearances at McDiarmid Park since promotion in 2018.
This game looked like another poor result in Perth as Makenzie Kirk and Benji Kimpioka hit back for the hosts.
Killian Phillips had put St Mirren ahead on 10 minutes but they lost momentum in the second period.
However, 17-year-old Evan Mooney came off the bench to score in his second substitute appearance to seal the dramatic finish.
As St Mirren got the three points
Home boss Simo Valakari, who had not suspended Sven Sprangler, introduced Adama Sidibeh as his only change as he rearranged his system to use a three-man attack.
Despite that firepower, they failed to threaten the visiting defence, with Alex Iacovitt appearing for the first time since August.
Mikael Mandron replaced Toyosi Olusanya in attack as St Mirren boss Stephen Robinson looked to address a lack of creativity and clinical touch in the final third in recent weeks.
Both issues were quickly resolved. Mandron created space for a 22-yarder and turned it out and sent a right pass through to match Phillips' run.
St Johnstone's hands went up to claim an offside but the Irishman timed it perfectly and sent a low finish past Rae.
Valakari made a direct swap at half time with David Keltjens replacing Lewis Neilson at right back.
The Israel international took just seven minutes to make his impact, with a pass to release Nicky Clark.
The St Johnstone captain connected with a stunning run from Kirk, who produced a terrific low finish beyond the reach of Ellery Balcombe for his third goal in five games.
Luke Kenny, 21, made his Premier League debut for the Buddies after Richard Taylor was carried off on a stretcher.
Phillips missed a good chance for St Mirren and there was wasted work at the other end from Sidibeh and Kimpioka.
However, Swede Kimpioka made amends by putting St. Perth ahead. Drey Wright's determination kept St Johnstone in attack mode and he played Kimpioka through on the left.
A brilliant first touch took him past the defenders and he fired into the top of the net.
The home side's defensive lapses returned, however, and they could not hold on.
Goalkeeper Rae offered an indecisive punch to a routine ball into the box and Mooney swept home a leveller.
Deep into stoppage time, VAR awarded Jason Holt a handball penalty and Idowu succeeded where O'Hara had failed, nine minutes into the first 90.