Ajax survived a heroic Schalke fightback - and the dismissal of Joel Veltman - as they reached the semi-finals of the Europa League despite going down to a 3-2 second-leg defeat at the Veltins-Arena.
Nick Viergever was the hero for the Dutch side, the defender deflecting Matija Nastasic's attempted clearance into the net in the 111th minute, before Amin Younes struck in the closing seconds to finally settle a see-saw tie.
Schalke had rallied from a 2-0 first-leg deficit to force extra time, Leon Goretzka and Guido Burgstaller scoring in the space of three second-half minutes to drag the Bundesliga team level on aggregate, although the former's night came to an early end due to a head injury.
Veltman also failed to see out the match, the defender dismissed with 10 minutes to go in normal time as Ajax - winners of the UEFA Cup in 1992 - seemingly collapsed down the stretch.
Daniel Caligiuri put Schalke on course for the last four when he nodded in a teasing Sead Kolasinac cross to make it 3-2 on aggregate, only Viergever and Younes to strike late and book Ajax's place in Friday's draw.
Markus Weinzierl's side started brightly and twice came close to halving the overall deficit inside the opening two minutes, Goretzka guiding a Kolasinac cross narrowly wide before Max Meyer's measured shot was kept out by a post.
However, the early Schalke onslaught failed to yield a goal, allowing Ajax to gradually grow into the game as the opening half wore on.
Just as he had done in a one-sided first leg, Ralf Fahrmann kept Schalke's hopes alive, the goalkeeper diving low to his right to turn away Lasse Schone's free-kick straight after the interval.
The save proved to be pivotal, as Schalke hit their opponents with a quickfire double to draw level.
Goretzka grabbed the first, the midfielder exchanging passes with Burgstaller to get clear on the right before firing an angled drive underneath Andre Onana's outstretched arms.
Ajax failed to regain their composure before conceding again, Burgstaller going from provider to scorer when he wrapped his left foot around Kolasinac's low cross to sweep a low shot into the net.
As if seeing a comfortable cushion disappear in a hurry was not tough enough for the visitors, they were then reduced to 10 men in the 80th minute when Veltman picked up a second yellow card for a blatant block on Nabil Bentaleb.
Onana made sure his team at least forced extra time with a crucial double save, first denying Benedikt Howedes before then scooping up the rebound just as substitute Klaas-Jan Huntelaar looked to pounce against his old club.
Yet there was nothing the Ajax keeper could do to keep out Caligiuri's header in the 101st minute, Kolasinac once again the provider with a teasing cross from the left flank.
Schalke's turnaround looked to be complete at that stage, only for Viergever's timely intervention on Nastasic to dramatically change the complexion of the game.
Younes capitalised on the counter to score a second for Ajax, who will now compete in the semi-finals of a major European tournament for the first time since 1997.