Livingston put an end to St Johnstone's long unbeaten run as they hauled themselves up into seventh in the Premiership table with a 2-1 victory in a hard-fought encounter at McDiarmid Park.
Saints' last league defeat came way back in early October but they succumbed at home to the Lions, whose victory will have boosted caretaker David Martindale's hopes of landing the vacant managerial job on a full-time basis.
Defender Jon Guthrie headed in the opener shortly after the interval, only for Chris Kane to score an equaliser six minutes later.
However, substitute Scott Robinson earned the visitors all three points and a third successive win since the departure of Gary Holt.
St Johnstone started the game looking like a team buoyed by the confidence of their unbeaten run and a draw away to Celtic six days previously.
The home side put their visitors under serious pressure in the opening exchanges but it was Livingston who created the first meaningful opportunity of the match.
Winger Josh Mullin found enough space on the right flank to whip in a cross that picked out a trademark run from Scott Pittman but Liam Gordon got in a vital block on the edge of the six-yard box.
There was plenty of effort from both sides but inspiration was in short supply as both defences cancelled out their opponents.
And it was a set-piece that came within a whisker of giving St Johnstone the breakthrough in the 30th minute.
David Wotherspoon swerved in a brilliant corner from the left but Kane's glancing header from close range crashed back off the crossbar.
The game got just what it needed just three minutes after the break when Livingston took the lead.
Kane conceded a free-kick 40 yards out and Guthrie looped his header back across Zander Clark from Mullin's excellent delivery.
However, the lead lasted just six minutes.
Kane met a Wotherspoon cross at the near post and used his chest to bundle the ball over the line from close range.
But, in a see-saw second-half, the visitors surged back in front with what proved to be the winner in the 65th minute.
Pressure in the midfield hustled Saints out of possession and Mullin instantly clipped a great pass over the top of the home defence. Robinson scampered clear and his first-time shot nestled in the back of the net.
A minute later, keeper Clark had to look smart to block a Jack Fitzwater shot on the turn after Saints had failed to cope with a long Nicky Devlin throw.
Livingston then held on stoutly as Saints piled on the pressure late on but a Jamie McCart volley that bounced straight into the arms of keeper Max Stryjek was the closest they came to an equaliser.