LEE Thomas' deflected extra-time strike put Llandudno through to the second round after a titanic struggle at Bastion Road.
The visitors took a 35th minute lead when Joe Morgan headed in a Leighton Griffiths corner, but Prestatyn equalised just past the hour when Jon Fisher-Cooke drilled home from 10 yards after great work from Jack Lewis and Michael Parker.
It was end-to-end until Thomas’ angled shot went in off Prestatyn defender Russ Jones.
Town had keeper Jon Dunt sent off four minutes from the end for a professional foul.