Match ends, AFC Fylde 1, Wigan Athletic 1.
Danny Rowe's second-half penalty earned non-league AFC Fylde an FA Cup second-round replay at League One Wigan Athletic.
The Latics, who won the competition four years ago, went ahead just before half-time through Will Grigg's header.
But the hosts equalised when Nathan Byrne brought down Sam Finley inside the box and Rowe struck from the spot.
Byrne had the chance to win it for Wigan late on but smashed his shot high over the bar.
Both sides will be in Monday's third-round draw, which takes place at 19:00 GMT and will be live on BBC Two and online.
Hard-working Fylde frustrate free-scoring Wigan
It was an impressive result for National League side AFC Fylde, with Wigan boasting the best attack and defence in League One.
They are top of the league, having scored 36 goals and conceded only 12 in 19 games, and for large periods of this match anything but a Wigan win looked unlikely.
The hosts were cautious in the first half, rarely venturing too far beyond the halfway line.
Instead it was Wigan who did all the attacking. Grigg hit the woodwork with a header before Lee Evans lashed well over when well placed inside the area.
It looked like AFC Fylde had done enough to go into the break level but a minute before half-time they were undone by a brilliant Byrne cross, which Grigg flicked home.
The visitors came out strongly after the break as they looked to kill off the game and Gavin Massey forced a smart save out of home goalkeeper Jay Lynch.
But Fylde brought on former Blackpool striker Matt Blinkhorn just after the hour and his introduction revitalised the hosts.
Blinkhorn put a header just wide with his first touch of the ball before Finley's direct run drew a foul out of Byrne inside the area and the referee immediately awarded a penalty.
Rowe, who had scored 13 goals in 21 games before the visit of Wigan, then confidently sent keeper Jamie Jones the wrong way from the spot to ensure his side are in the draw for the third round.
What they said - Fylde deserve all the plaudits
AFC Fylde boss Dave Challinor: "The first half was difficult. We knew they'd have possession. At half-time we wanted to get further up the pitch and make it a cup tie and do the horrible bits.
"We had to put them under pressure and ask questions.
"Wigan are the best side in this round. They're really good at what they do. We tried to match them up in the first half and we rode our luck. We had to stay in the game and the goal came at a good time for us. It gave us something to hang on to."
Wigan manager Paul Cook: "I think Fylde deserve the credit. It's their night and they deserve all the plaudits.
"The best way to disappoint teams is by scoring again and unfortunately we got it. Fylde deserve all the credit in the world, they're into the third round and they've got a good chance.
"They will be a tough test back at our place."
- 16RichardsSubstituted forGrandat 89'minutes
- 24EdmundsonBooked at 90mins
- 21EzeweleSubstituted forBlinkhornat 62'minutes
- 8FinleySubstituted forTaylorat 90+3'minutes
- 11MasseySubstituted forPowellat 73'minutes
- 17JacobsSubstituted forRobertsat 90'minutes
- 9GriggSubstituted forToneyat 88'minutes
- Darren Drysdale
- Shots on Target
Second Half ends, AFC Fylde 1, Wigan Athletic 1.
Attempt missed. Cheyenne Dunkley (Wigan Athletic) header from the centre of the box misses to the left. Assisted by Max Power with a cross following a corner.
Substitution, AFC Fylde. Jason Taylor replaces Sam Finley.
Corner, Wigan Athletic. Conceded by Jordan Tunnicliffe.
Attempt blocked. Nick Powell (Wigan Athletic) right footed shot from outside the box is blocked. Assisted by Gary Roberts.
George Edmundson (AFC Fylde) is shown the yellow card for a bad foul.
Sam Morsy (Wigan Athletic) wins a free kick in the defensive half.
Foul by George Edmundson (AFC Fylde).
Foul by Ivan Toney (Wigan Athletic).
Lewis Montrose (AFC Fylde) wins a free kick on the left wing.
Substitution, Wigan Athletic. Gary Roberts replaces Michael Jacobs.
Offside, Wigan Athletic. Max Power tries a through ball, but Ivan Toney is caught offside.
Substitution, AFC Fylde. Simon Grand replaces Jordan Richards because of an injury.
Substitution, Wigan Athletic. Ivan Toney replaces William Grigg.
Foul by Dan Burn (Wigan Athletic).
Sam Finley (AFC Fylde) wins a free kick in the defensive half.
Attempt missed. Nathan Byrne (Wigan Athletic) left footed shot from the centre of the box is high and wide to the left. Assisted by Michael Jacobs.
Lee Evans (Wigan Athletic) wins a free kick on the right wing.
Foul by Sam Finley (AFC Fylde).