Bohemians scored twice in the space of eight minutes to severely dent Sligo Rovers’ title bid at the Showgrounds.
Gavin Peers had put Rovers ahead with a header from a Joseph Ndo corner on 11 minutes.
But referee Alan Kelly awarded a controversial penalty on 74 minutes, when he deemed that Matthew Blinkhorn was holding Owen Heary in the area from a corner.
Killian Brennan smashed home the spot-kick, and a late winner from Aidan Downes earned Bohs all three points.
Rovers made three changes to the team that also had a controversial penalty awarded against them in Dundalk last time out. Raf Cretaro and Alan Kirby were recalled, while Jason McGuinness returned from a ban.
John Russell was handed a new position of right-back to deputise for the injured Alan Keane and the suspended Danny Ventre.
There were three changes to the Bohs team as well, with Ollie Cahill, Chris Forrester and Downes starting in place of Mark Rossiter, Christy Fagan and Robert Bayly.
Rovers defenders Conor Powell and Jason McGuinness were both facing their former team, but it was another Dubliner, Peers, that had the Bit O’ Red in front early doors.
Powell won a corner off former team-mate Heary on the left, before Ndo’s delivery picked out an unmarked Peers to head home in similar fashion to the goal he scored against Shamrock Rovers in June.
The game got a little sticky after this, with the stop-start nature favouring neither team. But with Iarfhlaith Davoren and Alan Kirby prominent, Rovers started to open up on the half-four mark, and Davoren’s ball into the area had just too much pace for the run of Eoin Doyle.
But the home side tried to over-elaborate once or twice and could have been punished had Chris Forrester’s shot not flown straight at Brendan Clarke.
Rovers did create another good chance before the break though, as Jason McGuinness broke out of defence and started a move that led to Kirby testing Murphy from inside the area after some more slick footwork by Davoren.
Bohs were quicker out of the blocks in the second half, and when McGuinness let a ball go behind him, Downes got in to slide the ball back to Ger O’Brien.
Peers dived in to make the block, and O’Brien’s appeals for a handball were waved away.
Rovers reacted by throwing on Blinkhorn, but were almost
caught on a counter-attack from their own corner, as Downes broke from his own half, but dragged his shot across goal.
But Bohs had their equaliser in controversial circumstances on 74 minutes, after Alan Kelly spotted a foul from a corner that Clarke had easily gathered.
He booked Blinkhorn and pointed to the spot, enabling Brennan to crash home the penalty.
Brennan fired an effort off the crossbar shortly afterwards as Bohs had their tails up, and they claimed a second on the counter-attack with eight minutes left.
Again it was Downes breaking from his own half, and this time he rounded Clarke before sliding the ball home from the narrowest of angles.
Sligo Rovers: 1 Brendan Clarke; 8 John Russell, 4 Gavin Peers, 20 Jason McGuinness, 17 Conor Powell; 10 Raffaele Cretaro (9 Matthew Blinkhorn 55), 6 Richie Ryan (Captain), 12 Alan Kirby (7 John Dillon 76), 15 Joseph Ndo, 3 Iarfhlaith Davoren (22 Aaron Greene 68); 11 Eoin Doyle.
Subs not used: 19 Ciaran Kelly, 16 Derek Foran.
Booked: Blinkhorn (74).
Bohemians: 1 Barry Murphy; 2 Owen Heary (Captain), 5 Liam Burns, 6 Aidan Price, 3 Ollie Cahill; 10 Chris Forrester (14 Mark Rossiter 63), 7 Keith Buckley (16 Anto Flood 83), 8 Glenn Cronin, 4 Ger O’Brien, 11 Killian Brennan; 9 Aidan Downes.
Subs not used: 20 Craig Sexton, 18 Roberto Lopez, 17 Kevin Feely, 15 Gary Burke, 12 Christopher Fagan.
Booked: Heary (13), Cronin (44), Flood (85).
Referee: Alan Kelly (Cork).