Gary Twigg scored his first goal of the season as the Hoops got their title challenge back on track with a win over Drogheda United at Hunky Dorys Park.
Rovers dominated what was a very lacklustre first half.
Their best chance came after 11 minutes when Ollie Cahill spied Paul Murphy off his line and attempted a lob from the edge of the Drogheda box, but Murphy watched as the ball went narrowly over the bar.
Cahill once again caused havoc among the Drogheda defence on 20 minutes with a deep cross to the back post from a right wing corner, but no attacking player could connect and Drogheda hacked the ball clear.
However, Rovers up their game after the break and opened the scoring on 47 minutes with a Robert Bayly wonder strike.
The former Sporting Fingal midfielder hit a swerving shot from 20 yards out which saw goalkeeper Murphy dive to his left in vein as the ball sailed into the top corner.
Drogheda then went close to claiming a quick equaliser from a Joe Kendrick free-kick.
The defender's effort cleared the wall but failed to dip enough and then minutes later Glen Fitzpatrick saw a shot cleared off the line by Danny Murphy as the home side pressed for an leveller.
John Flood missed a gilt-edge chance from five yards out as Pat Flynn headed a Mick Daly cross right in front of his goal to Flood who headed over.
Drogheda were denied at the death by two interventions from Alan Mannus in the Rovers goal.
The keeper kept his composure to deal with two dangerous crosses and help clear the lines.
However with seconds left in injury time, Rovers tallisman Twigg was left in acres of space and his pace helped him beat the offside trap and round Murphy before slotting home.
The Boynesiders face a daunting trip to Galway next in the league as Shamrock Rovers welcome bottom side Bray to Tallaght.
Drogheda United: P Murphy, P Crowley, C Treacy, J Kendrick A McNally, M Daly (J Duffy 88), J Flood, B King, G O’Connor, G Fitzpatrick, R Martin (R Brennan 79)
Subs Not Used: P Skinner, D Brennan, E McGill.
Booked: G Fitzpatrick, R Martin, A McNally
Shamrock Rovers: A Mannus, P Flynn, A Price, D Murphy, D Murray, O Cahill (S O’Connor 77), J Chambers, C Turner, R Bayly, B Dennehy (G Barrett 90), T Stewart (G Twigg 66)
Booked: R Bayly
Subs Not Used: R Duggan, E Stephens
Referee: A Buttimer