Livingston remain six points behind Falkirk at the top of the Scottish Championship after winning at Hamilton Academical.
A chance-laden first half surprisingly delivered only two goals.
Stevie May gave Livingston the lead after 40 minutes from point blank range, but within three minutes Kevin O ‘Hara produced a fine equalising header.
Lewis Smith's low second-half strike against his former club gave Livingston the lead and substitute Andy Winter grabbed a stoppage-time third to ensure all three points head to West Lothian.
The first half suffered a lengthy delay after a worrying injury to visiting midfielder Scott Pitman, who was eventually was able to walk up the tunnel after extensive treatment.
And after the break there was a similar delay as Dylan McGowan was treated for what appeared to be a broken nose.