Martin Scott scored a late winner as lowly Livingston came from behind to shock high-flying Dundee 2-1.
Second-placed Dundee had won each of their last four Scottish Championship matches and had tasted defeat just once in their previous nine
The visitors spurned a great opportunity shortly after the break as Peter MacDonald's penalty was saved by Darren Jamieson.
But MacDonald needed just three minutes to make amends as he fired home from the left side of the penalty area.
However, the hosts drew level within seconds as Keaghan Jacobs converted a corner from the lively Kyle Wilkie.
And substitute Scott, who had only been on the pitch for six minutes, snatched victory in the closing stages when he converted right-footed from close range.