Super Stevie May prodded in a dramatic late St Johnstone winner at Fir Park.
The experienced homegrown forward was alert right at the death to bank a valuable three points.
Jamie Murphy had come back to haunt his old club in the opening half to hoist the Saints ahead with a neat finish.
That had looked to be enough but Motherwell bundled in a 90th minute leveller.
But the Perth men failed to throw in the towel and May managed to guide over the line in the fourth minute of stoppage time before whipping his top off in celebration.
It is a victory that moves Callum Davidson’s men up the league table to sixth.
Early doors, Graham Carey was quick to show off his range of passing skill when sending Drey Wright down the right channel with a sweet outside-of-the-boot ball. The cross, with Alex Mitchell waiting to pounce, was blocked.
Not long after, from a well-worked corner, Melker Hallberg flighted into the path of Carey at the edge of the box. His connection was crisp but a sea of home defenders blocked progress.
Motherwell did soon threaten when Sean Goss, who spent time on loan at Saints previously, dragged a shot from distance wide of the post. It was never troubling Remi Matthews.
Perth players were knocking the ball around rather nicely at times but a touch of fortune sent Theo Bair through on goal courtesy of a Ryan McGowan deflection.
The Canadian forward decided to go for the early strike and, while it was on target, goalkeeper Liam Kelly made a comfortable save.
There was nothing Scotland international Kelly could do on 28 minutes, though. He watched a Murphy angled strike whistle low beyond him and into the bottom corner after a clever Bair assist.
It was almost two as the half-time whistle approached. Carey’s deep free-kick was nodded back across goal by determined Mitchell and lingering with intent was Andy Considine, who was just beaten to it.
The Perth faithful was craving another after the break and they almost had one just shy of the hour mark.
A lovely Cammy MacPherson pass sent Murphy racing clear down the left flank, whose cross was inches from finding Bair at the back stick.
Motherwell looked to respond with a chance of their own but Kevin van Veen’s shot from the edge of the box was gathered nicely by Matthews. Then a mix-up at the back post required a goal-saving block.
Saints brought fresh legs into the action in the 68th minute with May replacing Bair.
The hosts were pushing for a leveller as the game reached its latter stages and a wicked Paul McGinn cross only required an attacker’s touch.
Murphy was replaced by Ali Crawford with 10 minutes remaining as Saints attempted to steer over the finish line.
Matthews needed to be alert soon after to deal with a Goss effort that bounced into the turf and looped towards the top corner. The stretching goalkeeper tipped round his post.
Saints were being forced to hang on but conceded in the final minute when a corner was bundled beyond Matthews. That looked to be that.
But then May popped up at the other end to, after clever movement inside the box, nudge the ball past Kelly from close range. The scenes of celebration on the park and behind the goal were full of joy.