UCD are into the last eight of the Extra.ie FAI Cup after emerging victorious from a bizarre five-goal Terryland thriller, the winner one of those goals you rarely see.
A shocking mix-up in the United defence with three minutes to go decided a cracking game, Galway well on top at that stage and wondering how it went wrong.
Stand-in goalkeeper Matt Connor had the ball but seemed to spill it on the ground and it fell to Tommy Lonergan, who had an open goal to shoot into.
It was a perplexing conclusion to a fairly crazy game, United well on top in the second half but having nothing to show for it.
College led three times in this game but First Division Galway had most of the ball, only to blow their cup prospects and now be reliant on an unlikely promotion via the playoffs to the top flight.
This was a proper cup tie, played in front of a small crowd on a beautiful autumnal evening. UCD started with much of the ball but Wilson Waweru headed into their net on six minutes, only to be flagged offside.
However, UCD went ahead on 17 minutes through a youngster who has been making waves. The impressive Dylan Duffy's delivery was inviting but United defended it poorly and Lonergan connected to beat surprise starter Connor, who connected but failed to keep the ball out.
College had started to dominate now, an extremely small home crowd rescued to chatter or silence, with United's players seemingly lacking the confidence to get on the ball. When they did, Stephen Walsh, their hero this season, drove wide on 26 minutes.
As the game edged towards half-time, UCD seemed in control, much to do with United's inability to get going.
Duffy looked a talent and, United reeling, he drove a bullet of a shot just wide as half-time approached.
Out of nothing, United found some vigour and equalised just before half-time. David Hurley teed up Mikey Rowe, who drove into the bottom corner.
Galway started full of energy in the second half. Walsh hooked over after an Ed McCarthy pull-back, before Conor O'Keeffe volleyed into the side netting after running onto a clever quick free-kick by David Hurley.
However, they were suddenly silenced. Duffy put College back in front with a beautiful goal six minutes into the second half, finding the top corner from a free-kick.
This became a proper cup tie and United drew level on 65 minutes. Conor McCormack crossed for Walsh, who headed it back towards Hemmings and he made no mistake from close range.
Ronan Manning made a huge impact after coming on and, after feeding Waweru, Hurley forced a good save out of Kian Moore.
It was a rip-roaring tie now and Lonergan stole in behind the United line, Connor making a good block.
Then, an ending that words defy.
Somehow, United rallied, and Gallagher denied substitute Francely Lomboto from point-blank range in injury time. Their season now depends on the playoffs.
Galway United: Connor; O'Keeffe (O'Keeffe 90), Portilla (Lomboto 90), Finnerty; Hemmings, McCormack, Hurley (Hery 90), Rowe (Manning 70), McCarthy; Waweru (Manley 77).
UCD: Moore; Gallagher, Dunne (Ryan 67), Todd, Osam; Higgins (Dingam 82), Duffy, Keane, Caffrey, Brennan (Morris 82); Lonergan.