Substitute Joe Garner scored a hat-trick to knock Ipswich Town out of the FA Cup and book League One Preston a fourth-round trip to Nottingham Forest.
Frank Nouble gave the Championship visitors the lead after an error before 25-year-old former Forest striker Garner levelled with a header.
Garner made it 2-1 when he rifled past Scott Loach only for David McGoldrick to equalise with a close-range header.
Joe Garner factfile
Blackburn, 12 April 1988
Blackburn, Carlisle, Nottingham Forest, Watford, Preston.
Carlisle (twice), Huddersfield, Scunthorpe.
But Garner sealed a dramatic win for North End following a mistake.
The ex-Watford forward now has 12 goals in 22 appearances in all competitions for North End this season, his treble earning North End a place in the last 32 for the first time since 2010.
Ipswich have now failed to win their last six FA Cup ties, a run stretching four years.
A drab tie burst into life when Nouble pounced on a 58th minute mix-up between goalkeeper Declan Rudd and defender Keith Keane to put the visitors ahead.
Garner was introduced four minutes later and he did not take long to make an impact, the former Blackburn youth player heading Paul Gallagher's corner through a crowd of bodies in the 68th minute.
Less than a minute later, after good work down the right from Chris Humphrey, Garner controlled Kevin Davies' knock-down and cracked a low shot beyond Loach.
Extra-time looked to be on the cards at Deepdale when Ipswich substitute McGoldrick made it 2-2 from a Carlos Edwards cross in the 76th minute.
But Garner sealed a dramatic win after seizing on some slack defending in the box to turn and fire Preston through to the next round.
Preston manager Simon Grayson:
"Bringing Joe Garner on as your leading scorer isn't a gamble.
"He's got great movement, he's a brave lad, he'll get on the end of things and he's two-footed. He's playing with a lot of confidence and we want that to continue for a long time.
"It was a typical cup tie, especially in the second half, the first half there wasn't too much in it."
Ipswich manager Mick McCarthy:
"We've let them off the hook and conceded three very poor goals.
"I don't see any kids or inexperience in that team, it's a good team I've put out.
"It's not too often I've been this way. I try to be consistent in what I'm like, but I was annoyed with that."
Preston North End 23 Rudd 02 Keane 03 Laird 37 Kilkenny 05 Clarke 04 Huntington 07 Humphrey (Wright - 93' ) 30 Brownhill (Holmes - 79' ) 09 Davies 12 Gallagher 24 Hayhurst Booked (Garner - 62' ) Substitutes 01 Stuckmann 06 Wright 10 Beavon 11 Holmes 13 Byrom 14 Garner 27 Hume Ipswich Town 01 Loach 07 Edwards 15 Mings Booked 19 Hyam Booked 06 Berra Booked 05 Smith 16 Tunnicliffe 18 Tabb (McGoldrick - 74' Booked ) 35 Nouble 11 Anderson (Taylor - 73' ) 12 Hunt (Lee - 92' ) Substitutes 10 McGoldrick 22 Gerken 26 Taylor 29 Lee 31 Lawrence 32 Hammond 40 Clarke
Ref: Keith Stroud