A spectacular winning goal from teenager Robert Snodgrass added a desperately needed moment of magic to one of the poorest games in recent memory.
But Livingston were not complaining as their first home win in the league this season lifted them above Dunfermline at the bottom of the SPL.
With half-time approaching Snodgrass appeared to have few options, but he dipped his shoulder and shrugged off two tackles before beating keeper Derek Stillie with a swerving left-foot drive from just outside the penalty box.
Amazingly it was the first shot on target following a dire opening spell in which only Paul Dalglish of Livingston and Dundee United's Collin Samuel displayed any real ability in attack.
The second period was marginally better as the visitors piled forward in search of an equaliser and Barry Robson must have thought he was about to score it with 15 minutes left.
He sliced open the home defence only for French keeper Ludovic Roy to make a crucial block with his legs.
Samuel wasted a free header at the back post and then chipped fractionally wide, before Roy pulled off another important save from Lee Miller's glancing header.
Substitute Jim McIntyre should have done better with another clear cut opportunity four minutes from the end and when defender Greg Strong beat Miller to a loose ball inside the six-yard area with seconds remaining, Livi knew they were safe.