Longford Town 2 St. Patrick's Athletic 1
Captain Damien Brennan led by example to score the winner as bottom of the table Longford came from behind to make it four league wins in five games to stay on course for the great escape.
The win moves Longford, who were 13 points adrift little over a month ago, to within four points of second bottom Waterford United.
Erstwhile leaders St. Pat's have now won just once in their last seven league games and qualifying for Europe via the league is now in jeopardy.
John McDonnell's side started well, however, with Town keeper Shay Kelly making good saves from John Frost and Glen Fitzpatrick early on before Mark Quigley shot them in front from 10 yards.
But Town hit back to level on 23 minutes when Dave Mooney shot home a penalty after John Reilly was tripped by Stephen Paisley.
Keith Fahey volleyed over to miss a sitter for St. Pat's on 61 minutes before Town got their winner six minutes later.
Kevin Doherty knocked Jamie Duffy's free-kick to Mark Rutherford whose header set up Brennan to stab home from close range.