League One's Blackpool were made to work hard by Conference side Aldershot to reach the FA Cup fourth round.
Scott Vernon drilled in from 18 yards on four minutes and Andrew Morrell headed Pool's second before John Grant pulled one back from close range.
But after the break, Morrell slotted his second and Ben Burgess converted a penalty after he had been fouled by Rciky Newman to pull the hosts clear.
Mark Pritchard struck on 87 minutes as Aldershot made the score a bit fairer.
Blackpool manager Simon Grayson:
"I breathed a sigh of relief when Marcus Gayle put a few chances wide in the second half. I have played against him many times and know how he normally finds the back of the net.
"It was one of those games where they had nothing to lose and we had everything to lose.
"I thought that after we went two up, the next goal would really count. Had we scored it they would have been dead and buried. But it was them that scored and it became a bit of a battle after that."
Aldershot boss Terry Brown on going 2-0 down early doors:
"The way we came back after the shock of losing two early goals showed we had a lot of character.
"On another day we could have got ourselves level and it's game on.
"I still think we produced some good football and put them under a lot of pressure and I don't think any of the Blackpool players would deny us that."
Blackpool: Evans, Tierney (Gorkss 57), Barker, Jackson, Evatt, Farrelly (Burgess 57), Forbes, Southern, Fox (Bean 80), Vernon, Morrell.
Subs Not Used: Jones, Kay.
Goals: Vernon 4, Morrell 7, 73, Burgess 80 pen.
Aldershot: Bull, Barnard, Newman, Day, Edwards (Lee 76), Soares, Williams (Pritchard 86), Molesley, Scott (Smith 76), John Grant, Gayle.
Subs Not Used: Wells, Ridgeway.
Booked: Barnard, Newman.
Goals: John Grant 27, Pritchard 88.
Ref: C Oliver (Northumberland).