Derry defeated Longford 0-12 to 2-4 to progress to the All-Ireland Minor Football semi-finals but Cavan are out after losing against Kildare.
Three Shane McGuigan points helped Derry lead 0-3 to 0-1 but the Oak Leafers were stunned as Darragh Doherty and Peter Hanley hit Longford goals.
After leading by four at half-time, Longford were four clear after 54 minutes but Derry hit six late points.
Cavan's second-half comeback fell short as they lost 2-14 to 2-12 at Navan.
At Brewster Park, four of Derry's late points came from the impressive McGuigan.
A Jack Doherty score and Conor Glass's point sealed the win for a Derry team that wore black armbands as a mark of respect following the death of county senior player Aaron Devlin on Thursday.
Ciaran Kelly's goal helped Kildare take a 1-4 to 0-0 lead at Pairc Tailteann and the Lilywhites extended that advantage to 1-8 to 0-1 after Thomas Edward Donohue had opened Cavan's account.
However, goals from Donohue and Robbie Brady helped cut Kildare's lead to 1-11 to 2-2 by the interval.
Jimmy Hyland's 42nd-minute goal contributed to Kildare's 2-14 to 2-8 advantage in the second half but they were left hanging on at the finish as Cavan hit the last four scores.