Brighton secured an FA Cup semi-final clash against Manchester City as the Seagulls beat Millwall in a penalty shoot-out to complete a remarkable comeback.
Millwall appeared on course for what would have been a routine and well-deserved victory as Alex Pearce's 70th-minute header and an Aiden O'Brien goal had them two goals ahead with two minutes left on the clock.
But Brighton's substitutes got them out of trouble, Jurgen Locadia halving the deficit with a fine strike before David Martin flapped badly at a last-gasp Solly March free-kick to draw the visitors level at 2-2 and send the tie into extra-time.
Shane Ferguson was sent off at the death for kicking out at Lewis Dunk – before Lions defender Jake Cooper missed the decisive penalty, firing high over the crossbar as Brighton won 5-4 on penalties.
The result means Brighton have reached the FA Cup semi-finals for only the second time in their history, with City now standing in their way of reaching the final for the first time since 1983.
The hosts started on the front foot, Jed Wallace steering a shot wide before striker Lee Gregory, passed fit to play after suffering a calf injury in midweek, fired over.
A scrappy first 25 minutes saw both sides tussling for possession with neither able to take control of the tie, Beram Kayal slipping as he struck Brighton's first shot on goal and allowing Martin to make a routine stop.
Kayal missed the best chance of the half as he could only head tamely at Martin after getting onto the end of Anthony Knockaert's cross.
Millwall almost benefited from a defensive mix-up early in the second half, Ryan hitting his clearance onto Duffy from point-blank range before recovering in time to prevent Gregory taking advantage.
With the wind and rain intensifying, the chance of more errors was heightened – but Martin did well to get down low and pad away a Kayal shot from outside the box.
Ryan was also called into action, narrowing down the angle before saving Wallace's strike as the game started to open up – with Millwall skipper Shaun Williams drawing another stop from the Brighton goalkeeper soon after.
The hosts were again asserting superiority and Ryan prevented Gregory from opening the scoring before Cooper headed the resulting corner wide at the back post.
They would not be kept out at the next time of asking, however, as Pearce arrived unmarked to bullet a header past Ryan and give Millwall the lead with 20 minutes remaining.
Everything seemed to be set for Millwall to reach Wembley with a memorable win as O'Brien turned in Wallace's low cross – only for Brighton to finally respond.
Locadia's crisp turn and finish two minutes from time set the scene after he had been brought on to replace the ineffectual Knockaert.
Brighton secured a reprieve their performance barely merited as March sent a stoppage-time free-kick into the box with Martin – strong in the Millwall goal for much of the game – allowing the ball to float in over his head.
Millwall did not let their heads drop and started extra-time well, James Meredith's low shot palmed away by Ryan as Mahlon Romeo blazed the rebound over.
Martin was equal to March's next effort and the Millwall defence coped well in the closing stages of extra-time as Brighton camped out on the edge of their penalty area.
Ferguson was given his marching orders in the final minute of extra-time after kicking out at a prone Dunk, Locadia seeing a goal then ruled out for offside as the game went to penalties.
Glenn Murray smashed the crossbar with the first spot-kick to give an early advantage to Millwall, who converted their first three efforts only to see Ryan keep out Romeo's effort with his foot.
Stephens and Steve Morison then scored for their respective sides to take the shoot-out into sudden death, where Cooper blazed over the sixth penalty to send Brighton to Wembley.
ga('create', 'UA-72310761-1', 'auto', {'name': 'pacontentapi'});
ga('pacontentapi.set', 'referrer', location.origin);
ga('pacontentapi.set', 'dimension1', 'By Mark Mann-Bryans, Press Association Sport');
ga('pacontentapi.set', 'dimension2', '96913078-f578-49d0-8cc9-3f3d8f08e70a');
ga('pacontentapi.set', 'dimension3', 'paservice:sport,paservice:sport:club-news,paservice:sport:football,paservice:sport:match-reports,paservice:sport:uk,paservice:sport:world');
ga('pacontentapi.set', 'dimension6', 'story');
ga('pacontentapi.set', 'dimension7', 'composite');
ga('pacontentapi.set', 'dimension8', null);
ga('pacontentapi.set', 'dimension9', 'sport:football');
ga('pacontentapi.send', 'pageview', { 'location': location.href, 'page': (location.pathname + location.search + location.hash), 'title': 'Brighton see off Millwall in penalty shoot-out to reach FA Cup semi-final'});