No-one relishes a trip to Dumbarton these days, but Livingston handled this admirably to move within three points of third-placed Dunfermline Athletic with a game in hand.
Two Dumbarton goals at the death gave narrowed the scoreline but Livingston were on cruise-control by that stage.
Livingston knew what to expect from this revitalised Dumbarton. The home side made their intentions clear from the start when Bryan Prunty tested Andy McNeil with a shot in the opening minute that the goalkeeper dealt with comfortably.
Jim Lister also had an early opportunity but could not catch his shot properly and McNeil was untroubled.
Prunty caught McNeil out with a cross which drifted over his head and hit the top of the crossbar as Livingston escaped again.
Livingston finally responded and highly-rated midfield player Stefan Scougall managed to get in behind the Dumbarton defence but could not direct his shot on target.
Marc McNulty followed up with a decent effort from outside the area which slipped wide of the post.
The home side did not heed the warning and Livingston took the lead shortly before half-time, with Iain Russell producing an exquisite finish to guide an angled shot past Jamie Ewings from 12 yards.
Scougall doubled Livingston's advantage early in the second half with a close-range finish after Russell had beaten the Dumbarton offside trap.
McNeil protected his side's two-goal lead when he produced an instinctive save to keep out a free-kick from Scott Agnew which was flicked on by Prunty.
Mark Gilhaney pulled back a goal for Dumbarton with a left-foot shot but it only gave them false hope.
Jordan Morton should have sealed it for Livingston when he was clean through, but Ewings managed to turn aside his shot for a corner.
Russell, with a glancing header wide of Ewings, made it 3-1 before Morton scored a wonderful fourth goal from distance.
Remarkably, Alan Lithgow headed one back in the final minute and Prunty volleyed home from 18 yards deep into injury time, but it was not enough to matter.
Contextual targeting label: