A goal in the last minute from midfielder Eamonn Kavanagh helped Finn Harps to their second win of the season over Bohemians and gave them a three-point cushion in third spot in the table.
Harps should have been ahead at the interval, but were guilty of squandering two gilt-edged chances.
Stephen Kelly had the first opportunity when he raced onto a pass from Gavin Dykes in the 16th minute, but when he elected to pass instead of shooting Bohemians cleared the danger.
Five minutes later they were presented with another chance when Dempsey slipped as he attempted a clearance. But even though Tom Mohan managed to get past the Bohemians' goalkeeper, defender Tommy Byrne got back to prevent him from scoring.
At the other end, Bohemians, who rarely tested Brian McKenna in the first half, stunned Harps in the 41st minute when Peter Hanrahan headed in a free from Glen Wade. However, referee Hubert Byrne had spotted an infringement and disallowed the goal.
A minute into the second half, Harps were presented with another opportunity to score, but James Mulligan tried to control the ball instead of heading it past the stranded Dempsey and again Bohemians got the ball clear.
A forceful run by Bohemians midfielder Glen Wade saw him pass Gavin Dykes in the 55th minute but he blasted his shot wide.
The game seemed to be heading for a draw until a cross from Jonathan Minnock in the 89th minute forced Glen Wade to mis-hit his clearance. The ball fell nicely to Kavanagh who blasted in his first goal for Harps from six yards.
Finn Harps: McKenna, Vaudequin, Minnock, Boyle, Dykes, Kelly, Mohan, McGrenaghan, Speak, Mulligan, Kavanagh. Subs: McGettigan for McGrenaghan (44 mins); McHugh for Kelly (80 mins).
Bohemians: Dempsey, Broughan, Conway, Maher, Byrne, Wade, O'Hanlon, O'Connor, McGrath, Hanrahan, Mullen. Referee: H Byrne (Dublin).