Dundalk's three-year reign as champions of Ireland will go on for another while at least thanks to Michael Duffy's 87th-minute winner against ten-man Bray Wanderers at Oriel Park.
Stephen Kenny's side knew that they needed a win to have any hope of keeping the Cork City champagne on ice but it didn't look like they would get at as the game approached the latter stages.
However, Duffy kept his cool when he broke through on the inside left to rifle the ball through the legs of Peter Cherrie and with Cork dropping points against Bohemians in Dublin, yet another title party for The Leesiders has been postponed.
Dundalk had the better of a low-key first-half with David McMillan, who still has the golden boot in his sights, hammering a Jamie McGrath free over the top in the 24th minute.
The Lilywhites striker threatened again just past the half-hour, turning Hugh Douglas inside out only to see his toe poke saved by Peter Cherrie.
Two of Dundalk's youngsters almost combined for the opener in the 39th minute with Carlton Ubaezuono picking out Jake O'Connor at the near post but his chested effort came back off the upright and the sides went in scoreless at the interval.
The hosts opened the second half on the front foot with Chris Shields testing Cherrie with a ferocious drive.
Bray were left to play the last half an hour with 10-men after Ryan Brennan was stupidly sent-off for two bookings in quick succession, right in front of his manager, Harry Kenny.
The former Drogheda United midfielder received a ticking off from referee Sean Grant after reacting to an earlier tackle by Lilywhites full-back Shane Grimes.
When play resumed, Brennan had a go at his former Drogs teammate, resulting in a booking, before talking himself into a red card with an act of dissent.
Cherrie stood firm to push away a McMillan effort in the 76th minute and then got down to his right to gather a Robbie Benson strike.
Knowing that they needed a win to stop Cork City from being crowned champions, Dundalk pushed for the breakthrough and almost got it with six minutes to go when Duffy broke free on the left but his cutback was diverted wide from eight yards by the incoming Benson.
That looked like it would be the last chance of the game but Dundalk staged a late rally and Duffy seized a McGrath pass to smash home a crisp drive, cutting the gap at the top to six points in the process, and leave Cork waiting yet again.
DUNDALK: Gary Rogers; Sean Gannon, Brian Gartland, Sean Hoare, Shane Grimes; Chris Shields, Jake O'Connor (Jack O’Keefe 69); Michael Duffy, Jamie McGrath, Carlton Ubaezuono (Robbie Benson 56); David McMillan.
BRAY WANDERERS: Peter Cherrie; Keith Buckley, Hugh Douglas, Conor Kenna, Karl Moore;
Ryan Brennan, Gary McCabe, John Sullivan, Darragh Noone, Jason Marks; Aaron Greene.
REFEREE: Sean Grant.