Wexford came best in extra-time, as they dug deep to claim a 2-15 to 0-16 SFC Qualifier win over Longford at Glennon Brothers Pearse Park on Saturday.
Daithi Waters bagged a crucial 1-01 in the closing 15 minutes of normal time, with a seventh Sean McCormack point forcing extra-time for Longford.
Before 2,200 spectators, goals from PJ Banville and Waters brought Wexford into contention in the second half, having trailed by four points with 15 minutes remaining.
Wexford were sharpest in extra-time, outscoring Longford by 0-07 to 0-02.
Wexford boss Aidan O'Brien made one change with Paddy Byrne coming into the half-forward line in place of Ben Brosnan.
There were also doubts over whether Horeswood clubman PJ Banville would start but the corner-forward passed a late fitness test.
Lee Chin was also an absentee due to a knee injury, and wasd replaced by Barry O'Gorman in the subs, with Colm Morris also added to the bench.
Longford manager Glenn Ryan stuck with the same 15 named in the match programme, with former AFL player Michael Quinn failing to start due to injury, but the Killoe Young Emmets clubman was listed among the substitutes.
The hosts were firmly fired up for this encounter, and although Sean McCormack watched a fourth minute shot come off the posts, JJ Matthews slotted the ball over the crossbar from the rebound.
Longford wouldn't trail during an impressive opening 35 minutes from the hosts following this score, with the sides level for the only time in the first half soon after.
Defender Adrian Flynn slotted over the first of his two first half points from play in the eighth minute, but Longford took command once more following a fine points from Shane Mulligan, after Bernard McElvaney and Paul Barden were involved in the build-up.
Further points from Sean McCormack (2) and midfielder John Keegan ensured a 0-5 to 0-1 lead after 20 minutes, with Longford firmly on top.
Paddy Byrne, Rory Quinlivan, Redmond Barry and Ciarán Lyng with missed opportunities at this stage for the visitors.
Wexford badly needed a score and were eventually rewarded in the 23rd minute, after Lyng cut the deficit to three points, with a score from a free.
The visitors were hugely wasteful in front of the posts at this stage, with St Martin's club man Lyng registering their sixth wide 10 minutes before the break.
Full-back Barry Gilleran broke up field to fist a point for the hosts and restore Longford's four-point lead.
Longford were hungry for scores, with Francis McGee baring down on the Wexford goalmouth, after a pass from Keegan.
However, goalkeeper Anthony Masterson was equal to the Dromard clubman's shot.
Wexford were beginning to dominate midfield at this stage, and were rewarded with two fine points from play, with James Holmes and Flynn on target.
With the gap reduced to two points, the visitors failed to drive on further before the break, as Longford finished strongly.
A pointed free from Sean McCormack, his third score of the game, broke a seven-minute scoring deadlock by the hosts.
Longford looked impressive, with a superb Michael Brady point handing them a 0-8 to 0-4 interval lead, after Paul Barden cut through the heart of the Wexford defence.
The Slaneysiders showed more urgency on the restart, and although bringing their wides tally to nine within two minutes of the throw-in, sharpened up in front of the posts.
Lyng and Aindreas Doyle involved, before Banville cut in for the game's opening goal in the 39th minute, to cut the gap to a point.
This however was Banville's last act, as he was called ashore by O'Brien to be replaced by Ben Brosnan for the closing 31 minutes.
Longford bounced back, with scores from Sean McCormack and Barden's left boot pushing them into a 0-10 to 1-4 lead in the 43rd minute.
The introduction of Brosnan provided an injection of pace into the Wexford attack, with the Bannow-Ballymitty clubman cutting the gap to two points in the 44th minute.
Longford moved 0-12 to 1-5 ahead with 17 minutes left on the clock following a sixth point from full-forward McCormack, but Wexford failed to give up.
The visitors responded yet again, with Waters goal in the 55th minute.
Wexford showing great character and resolve, with Paddy Byrne setting up the St Martin's man to ensure a 0-12 to 2-05 score-line.
Two unanswered points edged Wexford ahead for the first time in this game, and although Shane Mulligan equalised for Longford with eight minutes remaining, Wexford weren't finished yet.
Waters brought his tally to 1-1 with a 68th minute point, but McCormack remained composed to slot over an equaliser.
Longford had a late chance to win this game, but Barden bagged his third wide, and the hosts fourth of the night as referee Padraig O'Sullivan blew the full-time whistle.
Ugly scenes developed at this stage, but the Kerry official failed to produce a card, as both teams eventually headed for the dressing rooms.
Wexford were best in extra-time and raced four points clear thanks to scores from Redmond Barry, Shane Roche and Ben Brosnan.
McCormack kept Longford in touch, but the visitors led by 2-12 to 0-15 at the break.
Roche and McCormack swapped scores on the restart, but Wexford finished strongly with unanswered points from Flynn and Lyng to confirm a place in Monday's Round 3 Qualifier Draw.
WEXFORD: A Masterson; M Furlong, G Molloy, R Tierney; B Malone, D Murphy, A Flynn (0-3); D Waters (1-1), R Quinlivan; J Holmes (0-1), P Byrne (0-3, 1f), A Doyle (0-1); C Lyng (0-2, 1f), R Barry (0-2), PJ Banville (1-0).
Subs: B Brosnan for Banville (39); C Carty for Holmes (54); S Roche (0-2, 2f) for Lyng (67); K Gore for Doyle (71); A Doyle for Quinlivan (HTET); C Lyng for Barry (85).
LONGFORD: D Sheridan; D Brady, B Gilleran (0-1), D Reilly; B O'Farrell, P McCormack, S Mulligan (0-2); J Keegan (0-1), M Brady (0-1); B McElvaney, P Barden (0-1), P Foy; F McGee, S McCormack (0-9, 6f), JJ Matthews (0-1).
Subs: N Mulligan for McGee (57); D McElligott for Keegan (61); CP Smyth for D Reilly (65); A Rowan for Foy (68); M Hughes for Matthews (74); K Diffley for N Mulligan (85)
REFEREE: Padraig O'Sullivan (Kerry)