Armagh booked an Ulster SFC semi-final encounter with Donegal by overcoming Derry 0-17 to 0-15 at Celtic Park.
The Orchard county looked comfortable at the break as they led 0-11 to 0-5 but the hosts came back strongly in the second half, drawing to within a point.
Rian O’Neill’s free with the last kick of the game secured victory for Armagh and a shot at a first appearance in a provincial decider since 2008.
Derry’s wait for a first Ulster title since 1998 continues.
The Oak Leafers have not won an Ulster Championship game since 2015.
Armagh went into the quarter-final as favourites on the back of clinching a return to to Division One of the Football League last week after an eight-year gap.
Their promotion to the top flight meant there were two divisions between the protagonists in this Ulster clash and that perceived gulf in quality appeared apparent in the first half as a series of well-taken scores put Kieran McGeeney’s side in command.
The sides traded points early on, but with the help of a strong breeze, four unanswered points saw Armagh pull away to lead 0-6 to 0-2.
The visitors increased their advantage to six at the interval, by which time the conditions had worsened, the players having to contend with heavy rain in addition to the swirling wind.
The trusty left boot of Shane McGuigan spearheaded Derry’s revival after the resumption as Derry clawed back their deficit to three by the time Jamie Clarke was blac-carded for shirt-pulling.
Derry failed to make significant inroads during Clarke’s 10-minute absence but then a late flurry of points saw them trail by just one, 0-16 to 0-15, as the match went into added time.
Rian O’Neill’s free ended Rory Gallagher’s team’s resistance as the relieved away side ensured their passage to the last four – the stage of the competition at which they went out to Cavan last year.
Armagh will face Donegal, who beat Tyrone by two points in Ballybofey, for a place in the final on November 14.
Derry, who fielded four debutants in their starting line-up, had finished the league strongly with two wins, but must wait until next season to try and make an impact in the Championship given the straight knockout format being employed this season.
McGuigan ended as the game’s leading scorer with seven points, with Niall Loughlin (4), Chrissy McKaigue, Emmett Bradley, Ethan Doherty and Ciaran McFaul also pointing for the home side.
Rian O’Neill was Armagh’s leading scorer with four, while Jamie Clarke (3), man-of-the-match Rory Grugan (3), Aidan Forker (2), Oisin O’Neill (2), Jarlath Og Burns, Mark Shields and Conor O’Neill also go their names on the scoresheet.
Derry: O Lynch; P McNeill, B Rogers, C McWilliams; E Doherty, C McKaigue, P McGrogan; C McFaul, C Glass; D Tallon, E Lynn, Padraig Cassidy; Emmett Bradley, S McGuigan, N Loughlin.
Armagh: B Hughes; P Burns, R Kennedy, J Morgan; C O’Neill, A Forker, M Shields; O O’Neill, S Sheridan; R Grugan, C Cumiskey, S Campbell; J Clarke, R O’Neill, N Grimley.