Cavan look on the brink of an All-Ireland Quarter-Final place after they edged past wilting Derry after extra-time in Saturday's qualifier.
Derry led 0-3 to 0-0 before the Breffnimen fought back to lead 0-9 to 0-7 at half-time.
The Oak Leafers looked set for victory as they moved 0-18 to 0-17 ahead before Damien O'Reilly's last-gasp equaliser.
Cavan proved by far the stronger team in extra-time with Terry Hyland's astute substitutions proving crucial.
The win means Cavan will face the losers of Sunday's Connacht Final in the final round of qualifiers next weekend and that is likely to be London.
Derry manager Brian McIver appeared unhappy that referee Maurice Deegan didn't blow for full-time after Mark Lynch's eighth point had put the Oak Leafers ahead in the third minute of second-half injury-time.
Instead, Cavan had time for one final attack and they worked the ball upfield with O'Reilly holding his nerve to slot a fine point from play.
McIver could also point to Deegan's failure to award a first-half penalty as Eoin Bradley appeared to have blatantly hauled down in the square when the sides were level at 0-3 to 0-3.
The failure to hold on in normal time appeared to deflate the home side as Cavan took control in the 20 minutes of extra-time.
Huge substitute Michael Argue made a big impression as he steadied the Cavan midfield which had lost influential David Givney to injury in the early part of the second half while Darren McVitty also performed heroics after his introduction.
Argue and McVitty started the scoring in extra-time before the impressive Martin Reilly extended Cavan's lead to three.
With Derry's legs appearing to go, Cavan were able to run down the clock in the second period of extra-time by holding on to possession for long periods.
An Eoin Bradley point did cut Cavan's lead to two but Cian Mackey's goal sealed the Breffni County's victory with a close-range finish after Argue's point-blank effort had stuck a post.
Derry had made the better start to the contest with scores from Lynch, Enda Lynn and Bradley giving them an early three-point advantage.
However, Cavan responded with three unanswered points with Givney, Martin Dunne and Eugene Keating on target.
Then came a crucial incident as Derry were denied a stonewall penalty as Bradley was upended in the square although he did nudge Derry ahead from a free two minutes later.
But with Givney in superb form in midfield, Cavan moved into a 0-6 to 0-4 lead and the margin was still two at the break as they led 0-9 to 0-7.
The Breffnimen appeared to have suffered a massive blow straight after the restart as Givney was forced off with an apparent ankle injury.
Derry began to compete effectively in the middle third of the field with Lynch especially prominent.
Fine long-range points from Ryan Bell and James Kielt helped Derry cut the margin to a point but Cavan were three ahead again after excellent scores from the superb Martin Reilly and Keating.
But another amazing long-range point from Bell started a burst of three straight Derry scores as they got on terms again.
As the match ebbed and flowed, Cavan moved ahead again after Keating and McVitty points.
But with Derry's midfield dominance becoming a factor, the Oak Leafers hit three straight points to lead again with Emmett Bradley putting them 0-17 to 0-16 ahead on 56 minutes.
Cavan drew level again thanks to a Martin Reilly point but after substitute Emmett Bradley had missed a Derry chance, the Oak Leafers appeared to have won it thanks to Lynch's eighth point.
But much to Derry's annoyance, there was still time for a further Cavan attack which was finished off with Damien O'Reilly's cool finish.
Derry: Eoin McNicholl; Aidan McAlynn, Chrissy McKaigue, Dermot McBride; Charlie Kielt, Mark Lynch (cpt), Sean Leo McGoldrick; Patsy Bradley, Conor McAtamney; Benny Heron, James Kielt, Enda Lynn; Ryan Bell, Eoin Bradley, Emmett McGuckin.
Cavan: Alan O'Mara; Thomas Corr, Rory Dunne, Killian Clarke; James McEnroe, Alan Clarke (cpt), Ronan Flanagan; Damien O'Reilly, David Givney; Cian Mackey, Jack Brady, Feargal Flanagan; Martin Reilly, Martin Dunne, Eugene Keating.
All-Ireland Football Qualifiers round three - Saturday 20 July
Galway 1-11 0-09 Armagh
Wexford 2-08 0-16 Laois
Kildare 0-12 1-11 Tyrone
Derry 0-20 1-22 Cavan (aet)
All-Ireland Football Qualifiers round four draw - Saturday 27 July - neutral venues
Galway v Cork, Croke Park, 17:00 BST
Wexford or Laois v Donegal or Monaghan, time and venue tbc.
Kildare or Tyrone v Meath, Croke Park, 19:00
Cavan v Mayo or London, time and venue tbc.