Michael Murphy's injury-time penalty helped Glenswilly snatch victory over heartbroken Cavan Gaels in Sunday's Ulster Club SFC preliminary round tie.
Two late points from Conor McCleary appeared to have earned victory for the Cavan side who had led by three points at one stage in the first half.
However, Neil Gallagher was adjudged to have been fouled in injury-time and Murphy blasted home the penalty.
The victory earns the Donegal side a quarter-final clash with Latton.
That game is scheduled to take place on Sunday 30 October but it is likely to put back because of Murphy's involvement in Ireland's International Rules Test series in Australia.
Gaels had the breeze in the first half at Breffni Park and two Micheal Lyng points helped the Cavan side lead 0-3 to 0-1 early on.
Points from Kealan McFadden and Murphy cut Gaels' lead to 0-4 to 0-3 but Dominic Reilly and Seanie Johnston scores left three between the sides.
The Cavan side also wasted a goal chance shortly after Reilly's point with Martin Dunne delaying his shot and then seeing his effort blocked.
In a tight low-scoring game, Glenswilly needed to fight back before the break and that's exactly what they did as Darren McGinley, Gary McDaid and Gary McFadden all pointed before the break to bring the sides level.
Niall Murray edged Gaels ahead after the restart before frees from McDaid and Murphy put Glenswilly ahead for the first time in the match by the 41st minute.
However, Sean Reilly's move to midfield then began to pay dividends for the Cavan outfit as Kevin Meehan's superb levelling score was followed by McCleary's seemingly decisive points on 55 and 58 minutes.
But Glenswilly refused to yield and in the first minute of injury-time, Ciaran Bonner's high ball into the large square was grabbed by Gallagher who - according to the referee - was then fouled by Eamon Reilly.
Playing at the same ground where his late penalty miss cost Donegal victory in last year's All-Ireland Under-21 final, Murphy stepped up for the spot-kick but he superbly held his nerve to plant the ball into the net.
Seanie Johnston had a difficult late free in the final minute of injury-time but failed to get the distance as Glenswilly celebrated a somewhat unlikely victory.