UCD took a massive step towards Premier Division safety as a David McMillan brace helped them to a vital win over bottom-of-the-table Dundalk at Oriel Park.
The home fans were stunned into silence when 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.
Dundalk wasted two clear-cut chances in a lively first half. Michael Rafter ballooned an effort over the top when it looked easier to score and the same player shot straight at Mark McGinley when put clean through.
Ciaran Nangle rattled the woodwork in the 26th minute and six minutes later UCD took the lead when McMillan hooked the ball home at the far post.
Parity was restored in the 58th minute after McGinley was left with no chance thanks to Marc Griffin's unintentional deflection on Rafter's shot.
As Dundalk increased the tempo, Griffin and Lorcan Shannon both shot wide, but it was UCD who got the winner when McMillan sent Peter Cherrie the wrong way after Danny Ledwith was fouled.
DUNDALK -- Cherrie; Whelan, Foran, Shields, Osborne; Mountney, Maher, O'Brien (Reilly 66), Shannon; Griffin, Rafter (Conlon 75).
UCD -- McGinley; Douglas, Kavanagh, Leahy, Nangle; O'Conor, McCabe, Ledwith; Clarke (Burke 68), Benson, McMillan (Lyons 89).
REF -- D Hancock (Dublin).