Hamilton stretched their unbeaten league run to 13 games and hauled themselves back into the promotion race after defeating Albion Rovers 3-2.
But they lived dangerously in the closing stages when Albion scored twice and almost snatched an equaliser.
Hamilton opened the scoring after 18 minutes when Todd Lumsden was careless with a backpass that left goalkeeper Chris Fahey stranded. Alex Eadie snapped up the chance to put Hamilton ahead.
The hosts had more chances before they scored their second after 67 minutes when a superb shot on the turn from Allan Russell flew past Fahey into the far corner of the net.
Five minutes later a slip by Tom Tait left Fahey stranded and David MacFarlane slotted the loose ball into the net.
Hamilton looked fairly comfortable winners at that stage but Rovers staged a dramatic rally following a late double substitution.
The first came after 84 minutes when Kevin McBride smashed home a 30-yard strike after a defensive clearance from a Colin Waldie corner.
Martin Harty bundled the ball over the line with two minutes to go following another Waldie corner and Steve McCormick, a former Hamilton player, had the ball in the net in the closing seconds but it was disallowed following a previous infringement.