Sligo Rovers' Airtricity Premier Division title aspirations took a battering at Richmond Park as St Pat's reignited their chase for a European place with a dramatic win on the banks of the Camac.
The visitors enjoyed most of the possession and the chances with Matthew Blinkhorn and sub Eoin Doyle in particular posing a serious threat to the home side.
However, Pat's netted the winner on 67 minutes when Conor Kenna's deflected header from a Stephen Bradley free beat Rovers goalkeeper Brendan Clarke.
There was an excellent tempo to the game with both sides getting stuck in and showing attacking initiative. The visitors showed that little bit more of an appetite than theirs hosts and enjoyed several attacks on the Pat's goal.
Joseph Ndo teed-up Iarfhlaith Davoren for a strong low shot on 13 minutes but Gary Rogers in the Pat's goal saved well.
A minute later Pat's had a lucky escape when a ricochet off Aaron Greene headed back toward goal but went narrowly wide.
Seconds after that John Russell put the ball into Blinkhorn in the box but he slipped at the vital moment.
At the other end, Daryl Kavanagh went close with a back-header from Anto Murphy's long throw-in but saw his effort go narrowly wide while Blinkhorn failed to convert with his header from Russell's ball for Rovers on 25.
Kenna did well on 32 minutes to clear Blinkhorn's blistering inswinging cross at the near post before the inrushing Danny Ventre could connect.
Pat's had a chance to take the lead on 39 minutes when they cleared a Richie Ryan corner and Bradley darted up the pitch with the ball.
When he had passed the centre circle he spotted Daryl Kavanagh to his left but his subsequent pass was too weak and Rovers easily tidied up.
Blinkhorn threatened again when he met Ndo's cross on 40 minutes but couldn't get his header past Rogers.
Having dominated for long periods of the first half, Sligo again looked dominant as the second period developed.
However, Pat's continued to prove hard to break down and Rovers boss Paul Cook made a change before the hour mark, bringing on Eoin Doyle for Blinkhorn.
That switched nearly did the trick just three minutes later. A wonderful Sligo move saw Ndo scoop the ball over the Pat's defence to Doyle, who timed his run perfectly to stay onside.
Doyle smashed a terrific shot over Rogers from the right but his shot went over the bar.
Pat's went ahead against the run of play on 67 minutes. Bradley's free kick came into the area and following a scramble Kenna got his head to the ball to divert it past Clarke with the ball taking a slight deflection off Jason McGuinness on its way in.
A late Sligo rally saw subs Alan Kirby hit the crossbar on 88 and Raf Cretaro have a header saved by Rogers on 90 before Ryan fired wide in injury time.