A Rory Grugan point in the fifth minute of stoppage time snatched an unlikely win for Armagh to boost their promotion hopes from Division Three of the Allianz Football League.
His 30 metre point put Kieran McGeeney's side in front for the first time against 14-man Longford, who were annoyed not to leave the Athletic Grounds with at least a draw.
Despite losing Andrew Farrell to a second yellow card five minutes after the interval, Longford led for most of the way and Donal McElligot nailed a 58thminute penalty, after Brendan Donaghy handled the ball on the ground, to put them 1-09 to 0-09 in front with James McGivney quickly stretching their lead to four.
Armagh bossed possession but kicked eight second-half wides and struggled with their free-taking all afternoon, which left them chasing the game in a fraught finish.
Ethan Rafferty top-scored with 1-4, and probably missed the same amount again, but his goal after 69 minutes was the controversial – and pivotal – score.
McElligot appeared to be pushed in the back but referee Noel Mooney waved play on and Rafferty somehow wriggled his way through some busy traffic to squeeze the ball inside the near post.
The home crowd sensed a smash and grab win was there for the taking and Grugan popped up with the crucial point to put Armagh top of the table.
Longford had a great start and will wonder how this game got away from them having led 0-04 to 0-01 after 16 minutes, Longford free-taker David McGivney converted two before being black-carded.
The visitors played with good width and caused Armagh plenty of trouble moving the ball quickly.
Armagh went 16 minutes without a score but then landed three in three minutes through Stephen Sheridan, Rory Grugan and Ethan Rafferty.
Grugan's the only real goal effort of the first half, after Sheridan won a poor kickout, but Paddy Collum dived brilliantly to his left to tip the shot over the bar.
Longford, and in particular Robbie Smyth, responded well to Armagh drawing level for the first time at four points each.
The corner-forward landed three first-half points, a couple of them from the tightest of angles, with his trusty left boot.
Michael Quinn's snapshot from 35metres in front of the posts put Longford 0-07 to 0-04 ahead after half an hour to restore their three-point advantage.
Ben Crealey scored a spectacular long-range point with the outside of his right boot for Armagh, who trailed 0-08 to 0-05 at half time.
They drew level at 0-09 each in the 56th minute with Rafferty and Gregory McCabe on target and despite McElligot's penalty stretching Longford clear again, an unanswered 1-2 from Armagh in the last 10 minutes resulted in a dramatic victory.
Scorers for Armagh – E Rafferty 1-04, R Grugan 0-03 (1f), G McCabe, S Sheridan, B Crealey 0-01 each, N Grimley 0-01 (f)
Scorers for Longford – R Smyth 0-03 (3f), D McElligot 1-00 (pen) D McGivney 0-02 (2f), D Reynolds 0-02, M Quinn, D Mimnagh, J McGivney 0-01 each
Armagh: B Hughes; P Burns, A McKay, B Donaghy; N Rowland, G McCabe, M Shields; S Sheridan, C Vernon; R McShane, A Forker, N Grimley; R Grugan, B Crealey, E Rafferty
Subs: A Duffy for McShane (45), M Stevenson for Crealey (61), J McElroy for Donaghy (62), A Findon for Sheridan (71), R Kennedy for Duffy (BC, 73)
Longford: P Collum; P Fox, P McCormack, D McElligot; M Quinn, B Gilleran, D Mimnagh; D Gallagher, A Farrell; B McKeon, D McGivney, D Reynolds; R Smyth, C Berry, R Brady
Subs: P Foy for McCormack (13), J McGivney for D McGivney (BC, 23), R McEntire for Brady (47)
Referee: Noel Mooney (Cavan)
A goal at the death wasn't enough to help Wexford get off the mark in Division 3 as they fell to a three point defeat at home Westmeath in Innovate Wexford Park on Sunday afternoon.
It was a clash between two promoted sides in Wexford and it is the midlanders who, as expected, are finding life easier in the third tier, having beaten Derry on the opening weekend before slumping to a three-point defeat at home to table toppers Armagh last Sunday.
Their shooting was desperately wayward against Wexford but they still had far too much for the hosts on the afternoon.
Westmeath's defence coped well against the wind in the first half and Kieran Martin slotted over a couple of lovely points from play to give the visitors a 0-06 to 0-04 lead at the break.
They struggled to open up any substantial gap early in the second half but from around the 50th minute mark they began to pull away with star man John Heslin - who until then had been hitting only frees - curling over a pair of delightful points from play.
The game rather petered out after that with Westmeath stretching their lead out to seven points at one stage.
Wexford's Glen Malone notched the final point of the day before Tiernan Rossiter slammed home a goal from the rebound to reduce the margin to a goal.
Unfortunately for the hosts, this three-pointed fell on the point of full-time and Westmeath were already home and dry.