Richie Purdy salvaged an improbable win for Shamrock Rovers with a goal two minutes into time added on at Morton Stadium yesterday to keep them three points clear at the top of the Premier Division table.
It was a harsh result for Galway, who had come right back into the game to make a match of it in the second half, but whose lack of a cutting edge in attack once again proved crucial.
A player more accustomed to playing in defence, Purdy, revelling in his role as a striker, had put Rovers ahead early on before arriving unmarked to head home the all important goal from Billy Woods's corner to paper over the cracks of Rovers's worst display of the season.
"We got the three points and I'm grateful for that," said Rovers manager Damien Richardson. "I'm honest enough to say that whether we deserved it is of no importance. We simply didn't perform well and that's the disappointing aspect of the afternoon."
Despite controlling much of the first half, Rovers had to be content with going in level at the break.
Woods, in such effective form of late, signalled Rovers's intent right from the start, cracking a right-foot shot off a post from Tommy Dunne's quick free-kick after just four minutes.
Nine minutes later, Rovers were in front. Again Woods was involved as he picked himself up after being fouled by Luther Watson to send in a pacey free-kick which Purdy netted with his head.
Galway didn't register their first attack on goal until the 31st minute when Eric Lavine got in behind the Rovers defence onto Gareth Gorman's through ball only to shoot into the side-netting.
It lifted the siege only briefly as Rovers hit back again in the guise of Purdy whose diving header from Jason Colwell's cross flew wide.
However, a late first-half flurry by Galway brought them their reward with an equaliser right on 45 minutes.
Don O'Riordan's side's inventiveness from set-pieces has been successfully utilised this season and again they almost scored from a free-kick a minute before levelling.
Shane Jackson was booked for pulling down Lavine, but further punishment almost arrived when Rovers goalkeeper Tony O'Dowd had to react well to parry away Billy Clery's powerfully struck free-kick.
Jackson was caught out again seconds later when he handled as David Goldbey tried to knock the ball past him from Adrian Cregg's pass. Clery scored emphatically from the resultant penalty.
That knocked Rovers out of their stride and Galway enjoyed their best spell of the match early in the second-half. Woods again relit Rovers's spark on 58 minutes, however briefly, setting up Cousins at the near post with Hickey saving bravely.
Hickey was called on again within a minute when he had to palm a well-struck shot from Tracey round a post. Galway's strikers haven't scored a goal this season and it was easy to see why with Goldbey wasting two excellent chances when twice failing to get his head to wonderful crosses by Gorman and then Cregg late on.
Rovers then stole the game on 92 minutes. Brian Byrne forced a corner off Clery and Purdy punished sloppy marking by Kieran Foley to head Woods's corner to the net.
SHAMROCK ROVERS: O'Dowd; Britton, Jackson, Palmer, Dunne; Robinson, Colwell, Tracey, Woods; Cousins, Purdy. Subs: Byrne for Robinson (64 mins), Crowley for Colwell (75 mins), Horgan for O'Dowd (93 mins).
GALWAY UNITED: Hickey; Watson, Foley, Clery, Quirke; Cregg, Neary, Sheridan, Gorman; Lavine, Goldbey. Subs: Killeen for Goldbey (87 mins).
Referee: H Byrne (Dublin).