St Johnstone manager Simo Valakari endured a difficult return to Fir Park as Motherwell inflicted a third straight Scottish Premiership defeat on his side.
Valakari returned to the club he spent four years with as a player but his former club showed St Johnstone no mercy as they opened up a 2-0 lead by half time after a brilliant counter-attacking display.
Tawanda Maswanhise headed home from Marvin Kaleta's cross to open the scoring before Tom Sparrow's arrowed low strike put Motherwell in firm control.
However, St Johnstone were given a lifeline just before the hour mark when the video assistant referee spotted a handball by Andy Halliday as he blocked Graham Carey's shot.
Captain Nicky Clark took responsibility and stroked in a convincing penalty to get his side back into the game.
It descended into a frantic final half hour but neither side showed enough in the final third, before St Johnstone thought they had grabbed a 91st-minute equaliser.
Carey's corner was steered into the net by Jack Sanders, but VAR got involved for the second time after spying the defender had used his arm to score.
Motherwell then held on to remain in fifth place, level on 19 points with Dundee United and Rangers above them.
St Johnstone are down in 10th place after losing their third league game in a row.