They say you need a bit of luck to win a trophy and St Patrick's Athletic had it in spades at Oriel Park last night as Rory Feely's 114th-minute goal booked the EA Sports Cup holders a place in the quarter-finals at the expense of a Dundalk side who will wonder how they lost this tie.
Battered by the hosts throughout, Pat's landed a sucker punch when Feely prodded the ball past Gabriel Sava after Dundalk failed to deal with a Conan Byrne free-kick.
At that stage, penalty kicks looked to have been Pat's best chance of advancing as Stephen Kenny's side knocked continuously on the door.
The pattern was set as early as the first minute when teenager Michael O'Connor rose to connect with a John Mountney corner but he could only divert his header over the top.
Dylan McGlade was the architect of Pat's best chance in the 11th minute. He showed Shane Grimes a clean pair of heels before cutting back inside and teeing up Shane McEleney, who saw his fine strike tipped around the post by Sava.
Dundalk always looked the most likely after that and an intelligent Georgie Poynton run ended with the Irish U-19 international seeing his lofted attempt gathered by Brendan Clarke.
The experienced goalkeeper required treatment midway through the half but he soldiered on and almost single-handedly kept Dundalk at bay.
The woodwork denied the Lilywhites just two minutes before the break. Poynton burst into space again before letting fly with a 25-yard effort that kissed the top of the crossbar. Clarke then saved two Ciaran Kilduff efforts either side of O'Connor seeing a goalbound effort hacked off the line by Lee Desmond.
Dundalk battered the Pat's back four in the second half but just couldn't make the breakthrough. Clarke denied O'Connor again before he eventually succumbed to injury, with Pat Jennings coming on to replace him in the 65th minute.
Extra time loomed but Dundalk almost won it right at the when substitute David McMillan's first time drive just cleared the bar.
It was more of the same in extra time with Dane Massey denied by a wonderful Jennings save in the 107th minute but Pat's landed the killer blow to stun the home support and maintain their grip on the trophy.