Peter Brezovan was Brighton's penalty shoot-out hero as he broke Wrexham hearts in a pulsating FA Cup replay.
Brezovan saved Dean Keates's penalty before Craig Mackail-Smith's decisive kick secured a home tie against Newcastle for the Championship side.
Manager Andy Morrell had given the home side a first-half lead with a stunning curler into the top corner.
Brighton had offered little until sub Ashley Barnes levelled on 77 minutes with a header which forced extra-time.
Did you know?
Wrexham player-manager Andy Morrell's strike was his third in the FA Cup this season
The defeat was harsh on the last non-league side left in the competition, who had more than matched their Championship opponents.
Brighton fielded a strong side and Matt Sparrow was the first to try his luck on goal inside the opening three minutes when his shot from outside the area flew past Joslain Mayebi's left-hand post before Nat Knight-Percival headed wide for the home side.
But the Dragons also made a positive start and Morrell's effort from six yards out was blocked by Brezovan before they went ahead in spectacular fashion on 23 minutes.
Following a strong run down the left, Danny Wright found Morrell on the edge of the area and the player-manager's curling shot found the top right corner of the goal.
Wrexham's defence were keeping things tight at the other end, although Mayebi caused panic when he dropped the ball following a cross before gathering at the second attempt.
A spell of Wrexham pressure resulted in a long-range effort from Jay Harris which was gathered by Brezovan.
Having finished the first half strongly, Wrexham started the second period brightly and full-back Curtis Obeng forced Brezovan to save inside the first two minutes.
Wrexham were dealt a blow on 58 minutes when the impressive Wright left the field on a stretcher after dislocating his elbow, and he was replaced by the experienced Glen Little.
Brighton were finding it hard to get a grip of the game and Will Hoskins fired over the crossbar from inside the area following Will Buckley's quickly taken free-kick.
Did you know?
Brighton have not lost to Conference opposition since Hereford in the first round in November 1997
In an increasingly end-to-end match, substitute Little fired over the crossbar after good work by Ashton and Morrell, while Sparrow wasted a rare chance for Brighton when he shot wide.
The home side were pressing for the second goal but against the run of play substitute Barnes, who had replaced Alan Navarro, equalised.
Wrexham failed to clear their lines and Sparrow crossed for Barnes to head in via the post.
Brighton were now pressing for a winner and Mackail-Smith's shot flew across the face of goal before Mark Creighton was forced to make a crucial last-ditch tackle.
Joe Clarke wasted a glorious opportunity to win it for the non-league side in injury time when he headed over the crossbar from Ashton's corner.
Even so, Wrexham almost had the perfect start to extra-time when from Ashton's corner Creighton's goalbound header was pushed away spectacularly by Brezovan.
His opposite number Mayebi was also called into action soon after when he denied substitute Torbjorn Agdestein, who was through on goal.
Both sides continued to press, with Buckley's header flashing across the face of Mayebi's goal before a Harris header nearly snatched a dramatic victory in the final minutes.
Penalties were required and the decisive moment came with Wrexham's first penalty, when substitute Keates saw his effort saved by Brezovan.
Both sides successfully converted their next four penalties before Mackail-Smith hammered home his spot-kick to secure a fourth-round tie with Newcastle.
Wrexham player-manager Andy Morrell: "The lads were absolutely fantastic today and they deserve all the credit that they get and on another day we might have nicked it as well.
"It wasn't to be, but I am so proud. We had the better chances I think, but I am not going to sit here and complain.
"They are devastated down there and I have told them I don't see why they should be.
"We have just given a decent Championship team a right run for their money, I can't fault any of them."
Brighton boss Gus Poyet: "It was a very difficult game. We knew we did not start well but the cup is about getting through somehow.
"When you come here you have nothing to win and everything to lose. If you win 3-0 that's normal. If you win on penalties you are lucky.
"So it is not easy. Saying that, most of the time it is credit to the opposing team and you can see how much it means for the players.
"It was a great FA cup tie, I can imagine how Wrexham feel. They were so close to having a great game here, but that's football, sometimes it goes for you and sometimes it goes against."
- 25 Mayebi
- 02 Obeng Booked
- 03 Ashton Booked
- 04 Creighton
- 06 Harris
- 07 Cieslewicz
- 18 Tolley Booked (Keates - 100' )
- 20 Knight-Percival
- 26 Clarke Booked
- 09 Wright (Little - 59' )
- 11 Morrell (Hunt - 104' )
- 21 Maxwell
- 14 Clowes
- 12 Keates
- 16 Hunt
- 17 Little
- 19 Anorllo
Brighton & Hove Albion
- 01 Brezovan
- 05 Dunk
- 14 Calderon
- 20 Vincelot Booked
- 31 Hall
- 08 Navarro (Barnes - 66' Booked )
- 10 Sparrow Booked
- 26 Bridcutt
- 30 Buckley
- 07 Hoskins (Agdestein - 66' )
- 12 Mackail-Smith
- 16 Ankergren
- 34 Sampayo
- 17 Harley
- 32 Kasim
- 44 Rodgers
- 09 Barnes
- 23 Agdestein
Live Text Commentary
Craig Mackail-Smith scores a penalty. Wrexham 4-5 Brighton on penalties.124:40 Penalty
Glen Little scores a penalty. Wrexham 4-4 Brighton on penalties.124:05 Penalty
Penalty scored by Inigo Calderon. Wrexham 3-4 Brighton on penalties.123:30 Penalty
Penalty scored by Neil Ashton. Wrexham 3-3 Brighton on penalties.122:46 Penalty
Liam Bridcutt scores a penalty. Wrexham 2-3 Brighton on penalties.122:23 Penalty
Johnny Hunt scores a penalty. Wrexham 2-2 Brighton on penalties.121:43 Penalty
Penalty scored by Matthew Sparrow. Wrexham 1-2 Brighton on penalties.121:07 Penalty
Penalty scored by Joe Clarke. Wrexham 1-1 Brighton on penalties.120:30 Penalty
Ashley Barnes scores a penalty. Wrexham 0-1 Brighton on penalties.120:08
Penalty taken by Dean Keates is saved by Peter Brezovan.120:01
All is set for the penalty shoot-out to start.120:00 +1:49
The match is going to penalties.120:00 +0:43
Outswinging corner taken by Will Buckley.119:01
Jay Harris takes a shot. Peter Brezovan makes a save. Inswinging corner taken left-footed by Dean Keates, save by Peter Brezovan.116:50
Effort on goal by Romain Vincelot from deep inside the penalty area misses to the right of the goal.115:00
Will Buckley takes the outswinging corner, clearance made by Nathaniel Knight-Percival.113:56
Romain Vincelot concedes a free kick for a foul on Glen Little. Curtis Obeng takes the free kick.112:37
Corner from right by-line taken by Dean Keates.111:26
The referee blows for offside. Joslain Mayebi takes the indirect free kick.109:37
Effort on goal by Curtis Obeng from deep inside the penalty area misses to the right of the goal.
Torbjorn Agdestein produces a header from inside the area that goes over the crossbar.105:01
The referee blows to get the second half of extra time under way.105:00 +0:09
Adrian Cieslewicz challenges Romain Vincelot unfairly and gives away a free kick. Peter Brezovan takes the indirect free kick.102:54
Indirect free kick taken by Peter Brezovan.102:54 Substitution
Substitution Johnny Hunt is brought on as a substitute for Andrew Morrell.102:54
Foul by Andrew Morrell on Lewis Dunk, free kick awarded.102:20
Glen Little has an effort at goal from deep inside the area missing to the right of the goal.100:56
Liam Bridcutt challenges Glen Little unfairly and gives away a free kick. Neil Ashton takes the direct free kick.99:02
Neil Ashton restarts play with the free kick.99:02 Substitution
Substitution Dean Keates replaces Jamie Tolley.99:02 Booking
Booking Romain Vincelot goes into the referee's book for unsporting behaviour.98:48
Adrian Cieslewicz fouled by Romain Vincelot, the ref awards a free kick.97:50
Liam Bridcutt restarts play with the free kick.97:50 Booking
Booking Jamie Tolley is shown a yellow card.97:29
Jamie Tolley concedes a free kick for a foul on Matthew Sparrow.96:20
Will Buckley takes a inswinging corner.96:05
Torbjorn Agdestein takes a shot. Blocked by Peter Brezovan.95:27
Neil Ashton fouled by Will Buckley, the ref awards a free kick. The free kick is swung in right-footed by Jamie Tolley.94:17
Corner taken by Will Buckley played to the near post, Joe Clarke makes a clearance.93:01
Inswinging corner taken by Jamie Tolley from the left by-line, Mark Creighton takes a shot. Save made by Peter Brezovan. Neil Ashton takes a inswinging corner from the right by-line played to the near post, Torbjorn Agdestein makes a clearance.91:40
Ashley Barnes concedes a free kick for a foul on Jay Harris. Joslain Mayebi takes the indirect free kick.90:25
Effort from inside the six-yard box by Adrian Cieslewicz goes wide right of the target.90:00 +7:26
The referee blows for the end of normal time.90:00 +6:17
Free kick awarded for a foul by Torbjorn Agdestein on Curtis Obeng. Joslain Mayebi restarts play with the free kick.90:00 +5:37
Lewis Dunk fouled by Andrew Morrell, the ref awards a free kick. Free kick taken by Peter Brezovan.90:00 +4:14
Inswinging corner taken by Neil Ashton from the right by-line played to the near post, Header from close range by Joe Clarke misses to the right of the target.90:00 +0:07
Direct free kick taken by Jay Harris.90:00 +0:07 Booking
Booking Ashley Barnes booked for unsporting behaviour.90:00 +0:01
Ashley Barnes concedes a free kick for a foul on Adrian Cieslewicz.88:57
Corner taken right-footed by Matthew Sparrow from the left by-line to the near post, save by Joslain Mayebi. Inswinging corner taken right-footed by Matthew Sparrow played to the near post, Joe Clarke manages to make a clearance.88:24
Unfair challenge on Ashley Barnes by Glen Little results in a free kick. Liam Bridcutt restarts play with the free kick.85:38
Effort on goal by Torbjorn Agdestein from long range goes over the crossbar.84:41
Craig Mackail-Smith has an effort at goal from the edge of the area that misses to the right of the target.81:56
Effort on goal by Adrian Cieslewicz from just inside the penalty area goes harmlessly over the target.81:17
Headed effort from deep inside the penalty area by Torbjorn Agdestein misses to the left of the goal.80:09
Lewis Dunk gives away a free kick for an unfair challenge on Andrew Morrell. Direct free kick taken by Neil Ashton.79:33
Jay Harris produces a header from deep inside the six-yard box that clears the bar.78:55
Short corner taken by Will Buckley.76:09
Matthew Sparrow provided the assist for the goal.76:09 Goal scored
Goal! - Ashley Barnes - Wrexham 1 - 1 Brighton Ashley Barnes scores a headed goal from inside the penalty area. Wrexham 1-1 Brighton.75:43
Jay Harris gives away a free kick for an unfair challenge on Will Buckley. Free kick taken by Matthew Sparrow.75:15
Adrian Cieslewicz takes a shot. Save made by Peter Brezovan.72:38
Foul by Will Buckley on Nathaniel Knight-Percival, free kick awarded. Joslain Mayebi restarts play with the free kick.71:33
Neil Ashton takes a short corner.69:05
Peter Brezovan takes the free kick.69:05 Booking
Booking The referee shows Joe Clarke a yellow card.68:53
Joe Clarke challenges Torbjorn Agdestein unfairly and gives away a free kick.68:17
Corner taken by Jamie Tolley from the left by-line to the near post, clearance by Torbjorn Agdestein.67:34
Effort from outside the area by Matthew Sparrow goes wide right of the goal.65:45 Substitution
Substitution Ashley Barnes joins the action as a substitute, replacing Alan Navarro.65:45 Substitution
Substitution Torbjorn Agdestein replaces Will Hoskins.62:29
Shot by Glen Little from deep inside the penalty area misses to the right of the target.60:19
Will Buckley produces a cross, Effort on goal by Will Hoskins from inside the penalty area goes harmlessly over the bar.60:19 Booking
Booking Booking for Neil Ashton for unsporting behaviour.60:09
Unfair challenge on Will Buckley by Neil Ashton results in a free kick.58:13 Substitution
Substitution Danny Wright goes off and Glen Little comes on.50:56
A cross is delivered by Adrian Cieslewicz.46:34
Curtis Obeng takes a shot. Blocked by Peter Brezovan.45:01
The match restarts for the second half.45:00 +2:20 Half time
Half Time The half-time whistle blows.40:27
Will Hoskins crosses the ball in from the free kick.40:27 Booking
Booking Curtis Obeng booked.40:18
Curtis Obeng challenges Romain Vincelot unfairly and gives away a free kick.38:40
Jay Harris takes a shot. Save by Peter Brezovan.36:45
Liam Bridcutt challenges Curtis Obeng unfairly and gives away a free kick. Neil Ashton takes the direct free kick.34:57
Outswinging corner taken from the right by-line by Matthew Sparrow, Jamie Tolley manages to make a clearance.33:16
Corner taken by Will Buckley played to the near post, Danny Wright manages to make a clearance.30:06
Jamie Tolley challenges Matthew Sparrow unfairly and gives away a free kick. Liam Bridcutt takes the direct free kick.27:36
The official flags Will Buckley offside. Joslain Mayebi restarts play with the free kick.26:10
Jay Harris fouled by Alan Navarro, the ref awards a free kick. Joslain Mayebi takes the indirect free kick.24:48
Craig Mackail-Smith produces a right-footed shot from inside the six-yard box that clears the bar.23:41
Neil Ashton takes the inswinging corner, clearance by Liam Bridcutt.22:32
Assist on the goal came from Danny Wright.22:32 Goal scored
Goal! - Andrew Morrell - Wrexham 1 - 0 Brighton Andrew Morrell finds the back of the net with a goal from just outside the area to the top right corner of the goal. Wrexham 1-0 Brighton.21:39
Free kick awarded for a foul by Joe Clarke on Liam Bridcutt. Grant Hall takes the direct free kick.18:49
Andrew Morrell takes a shot. Blocked by Peter Brezovan.18:18
Foul by Lewis Dunk on Danny Wright, free kick awarded. Neil Ashton takes the direct free kick.16:27
Foul by Jay Harris on Will Hoskins, free kick awarded. Free kick taken by Liam Bridcutt.15:30
Romain Vincelot gives away a free kick for an unfair challenge on Adrian Cieslewicz. Free kick taken by Joslain Mayebi.12:26
Will Buckley takes a outswinging corner to the near post, Mark Creighton manages to make a clearance.10:05
Neil Ashton takes the free kick.10:05 Booking
Booking Booking for Matthew Sparrow for unsporting behaviour.10:01
Matthew Sparrow challenges Neil Ashton unfairly and gives away a free kick.5:25
Unfair challenge on Romain Vincelot by Mark Creighton results in a free kick. Peter Brezovan takes the free kick.4:51
Matthew Sparrow gives away a free kick for an unfair challenge on Adrian Cieslewicz. Free kick taken by Neil Ashton.3:55
Headed effort from inside the area by Nathaniel Knight-Percival misses to the left of the target.3:36
Short corner worked by Neil Ashton.2:40
Matthew Sparrow has an effort at goal from outside the area missing to the wide left of the goal.2:02
Andrew Morrell is caught offside. Free kick taken by Peter Brezovan.1:36
Free kick awarded for an unfair challenge on Mark Creighton by Craig Mackail-Smith. Joslain Mayebi takes the free kick.0:25
The referee penalises Andrew Morrell for handball. Direct free kick taken by Grant Hall.0:00
The ref blows the whistle to start the match.
Live data and text provided by our data suppliers