St Patrick's Athletic took a huge step towards clinching third spot in the SSE Airtricity League and a European place when they scored two late goals to snatch victory from the jaws of defeat against Drogheda United at United Park.
Conan Byrne fired the Inchicore men into a ninth-minute lead with a brilliant curling effort, but the sides went in level at the break after Gavan Holohan drilled a low shot past Brendan Clarke in the 38th minute.
There was little between the sides in the second half, but Drogheda looked set to cause an upset when Peter McGlynn rifled a powerful shot to the Pat's net on 71 minutes.
But Daire Doyle headed into his own net to bring the Saints level as the game ticked into stoppage time and seconds later Christy Fagan slotted home the winner.
Pat's lined out with a powerful midfield trio of Keith Fahey, Killian Brennan and Greg Bolger and quickly took control, with Byrne forcing a fine save out of Micheal Schlingermann from their first real attack.
Byrne won his next duel with the Drogheda keeper, though, when he swept Pat's into the lead on nine minutes in sensational style, curling a brilliant dipping effort into the top corner from long range.
Bolger headed over the bar from a Byrne corner as the visitors looked to kill off the game early, but Drogheda gained a foothold and Holohan forced Pat's keeper Clarke to fist clear after good wing play by Carl Walshe.
The game entered a lull for a spell, but Holohan brought it back to life with a surprise equaliser for Drogs on 38 minutes, controlling Doyle's long pass and turning inside before drilling a low shot past Clarke.
Damien Richardson's charges also began the second half in encouraging fashion and their skipper Shane Grimes went close with a low drive in the 55th minute.
At this stage the visitors seemed content to let Drogheda have the ball and counter-attack when the opportunities arose, and one such chance presented itself when substitute Chris Forrester curled the ball narrowly wide of Schlingermann's left-hand post.
Yet it was the Boynesiders who struck again on 71 minutes to stun the Saints. Grimes and O'Neill worked the opening for Peter McGlynn, who struck a superb shot into the top corner of Clarke's net.
Pat's struggled to unlock a well-drilled Drogheda defence after that, but right at the death the Boynesiders crumbled.
The game was ticking into injury time when a Fagan cross was headed into his own net by Doyle, and barely a minute later the Drogs lost the ball in midfield and Forrester played in Fagan who rolled a low shot past the exposed Schlingermann.