Mayo have beaten Derry 2-14 to 2-11 in the All-Ireland Under-20 Football semi-final at Carrick-on-Shannon
A Ryan O'Donoghue goal put Mayo ahead but Derry responded with goals from Callum Brown and Oisin McWilliams to lead 2-2 to 1-2 after 14 minutes.
Mayo fought back to lead 1-7 to 2-3 at half-time and after Derry moved ahead again, Paul Lambert's goal restored Mayo's advantage.
Despite Owen Hartin saving O'Donoghue's penalty, the Connacht side held on.
After Hartin stopped the spot-kick, points from Declan Cassidy and Lorcan McWilliams cut Mayo's lead to only a point in injury-time but two late scores from Tommy Conroy gave the Connacht champions breathing space.
O'Donoghue hit Mayo's first goal after only 52 seconds but Brown beat four defenders before lashing in Derry's reply on 10 minutes and McWilliams' goal then put the Oak Leafers three ahead.
However, Mayo hit five of the remaining six first-half scores to go in a point ahead at the break with Ross Egan slotting three frees.
Mickey Donnelly's side regained the lead in the third quarter after scores from Lorcan McWilliams, Ben McCarron and Mark McGrogan.
However, defender Lambert's three-pointer restored Mayo's advantage and despite Hartin's penalty save and late points from McWilliams and Cassidy, the Connacht champions moved three ahead by the finish thanks to Conroy's two injury-time efforts.
In the frantic closing stages, Mayo also had Cathal Horan and Nathan Moran black carded.
Mayo's win sets up a decider against Kildare who edged out Kerry 1-14 to 1-13 in the other semi-final.