Derry 1-17 Cavan 0-18
Mark Lynch's tour de force and a storming final few minutes from Derry combined to secure a dramatic victory and a spot in Round 4A of the All-Ireland football qualifiers.
Lynch was immense at Kingspan Breffni Park with seven points as Derry came good late on for the second weekend running to keep their Championship challenge alive.
They finished strongly to see off Meath last weekend and outscored 14-man Cavan by 0-08 to 0-03 in the final 15 minutes or so here to secure a courageous win.
Cavan will kick themselves for letting victory slip away as they led by three approaching the hour mark but missed a great chance to go four clear when Seanie Johnston kicked a close range free wide.
Derry capitalised and twice drew level late on before securing the Round 3A win with late points from Emmet McGuckin, Enda Lynn, Niall Toner and Lynch.
Sub Toner hit three important points while McGuckin nailed an early goal that kept Derry in it when Cavan were on top.
Their reward is a place in Monday morning's Round 4A draw while Cavan, who lost Feargal Flanagan to a red card in first-half injury-time, are out of the Championship just weeks after drawing with Tyrone in Ulster.
Cavan overcame the oppressive six-day turnaround last weekend to beat Carlow in Round 2A after bowing out of the provincial championship following a semi-final replay defeat to Tyrone.
But boss Terry Hyland admitted they were nervous initially and they didn't kill off their Division 4 opponents until the last 20 minutes.
They started brighter this time and led for the majority of the first-half, taking a 0-11 to 1-04 lead into the interval.
It should have been more as they kicked seven wides and had the greater possession, much of it coming from their dominant midfield who cleaned up on Derry's kick-outs.
Gearoid McKiernan wore number 11 but started at midfield and scored four first-half points while Jack Brady was the only forward who didn't get on the score sheet in that opening period.
Brady, Michael Argue and Martin Reilly were all late additions to the Cavan team with Ciaran Brady, Liam Buchanan and Eugene Keating, a goal scorer against Carlow, missing out.
A 10th minute Derry goal from powerful full-forward McGuckin kept the visitors in the game.
Cavan were consistently troubled under the high ball to their full-back line and McGuckin rose up to punch Ciaran McFaul's delivery to the Cavan net.
James Kielt hit Derry's opening point but was black carded in the 23rd minute for a tangle with Conor Moynagh.
Cavan lost wing-back Flanagan in first-half injury-time for an off the ball incident that left Lynch, another of Derry's point scorers, grounded and clutching his midriff.
It was a timely boost for Derry who restarted with points from Conor McAtamney and Lynch to halve their deficit.
Cavan restored their three-point lead by the 58th minute and had that opportunity to move four clear but wasted it and Derry made them pay with a strong finish to move within touching distance of the All-Ireland quarter-finals.
Derry: T Mallon; K McKaigue, G McKinless, C McKaigue; C Mullan, B Rogers, C McFaul; C McAtamney (0-01), N Holly; D Heavron (0-1), E Brown, C Bradley (0-01); J Kielt (0-01), E McGuckin (1-01), M Lynch (0-07, 0-04f).
Subs: E Lynn (0-01) for Kielt BC, N Loughlin (0-01, 0-01 45) for Brown, N Toner (0-03) for C Bradley, E Bradley for McAtamney, L McGoldrick for Rogers, N Forrester for McFaul.
Cavan: R Galligan (0-03, 0-03f); P Faulkner, R Dunne, K Brady; F Flanagan, C Moynagh (0-01), K Clarke; T Corr, G McKiernan (0-04, 0-3f); D McVeety (0-03), M Argue (0-01), M Reilly (0-02); C Mackey (0-01), S Johnston (0-01, 0-1f), J Brady (0-01).
Subs: N Murray for Argue, C Brady for Faulkner, J McLoughlin for K Brady, T Hayes for Johnston, G Smith (0-01) for Corr, L Buchanan for Mackey.
Referee: E Kinsella (Laois).