UCD took a massive step towards Premier Division safety as a David McMillan brace helped them to a 2-1 win over Dundalk at Oriel Park.
McMillan dispatched an 81st minute penalty to move the Students seven points clear of Dundalk, all but consigning the Lilywhites to a relegation play-off spot.
McMillan had earlier given UCD a first-half lead only for a Marc Griffin deflection to draw the home side level. Darius Kierans's side looked good for the three points after that but they were left deflated when McMillan struck late on.
Both sides had clear cut chances in a lively first-half. Dundalk's Michael Rafter ballooned an effort over the top when it looked easier to score and the same player wasted the home side's best opportunity of the half in the 23rd minute.
Marc Griffin's pass set Rafter clear of the UCD back four but the striker wanted too much time and allowed Mark McGinley the chance to advance off his line and save.
Ciaran Nangle rattled the woodwork with a long distance drive in the 26th minute and six minutes later UCD took the lead when McMillan profited from dreadful defending to hook the ball home at the far post.
Dundalk should have drawn level in the 55th minute. John Mountney's attempted pass deflected kindly into the path of Marc Griffin but the striker blazed over with his volley.
Three minutes later and parity was restored as McGinley was left with no chance thanks to Griffin's unintentional deflection on Rafter's shot.
With their tails up, Dundalk increased the tempo and Griffin and Lorcan Shannon both fired wide with efforts but it was UCD who had the final say when McMillan did his bit from 12-yards.
DUNDALK: Peter Cherrie; John Mountney, Derek Foran, Paul Whelan, Eoghan Osborne; Stephen Maher, Mark O'Brien (Chris Reilly 66), Chris Shields, Lorcan Shannon; Marc Griffin, Michael Rafter (Barry Conlon 75).
UCD: Mark McGinley, Hugh Douglas, James Kavanagh, Michael Leahy, Ciaran Nangle; Paul O'Conor, Barry McCabe, Daniel Ledwith; Dean Clarke (Gary Burke 68), Robbie Benson, David McMillan (Chris Lyons 89).
REFEREE: Damien Hancock (Dublin).