Going into Tuesday's last eight second legs, Real seemed certain of a place in the semi-finals after their 3-0 win over Galatasaray at the Bernabeu last week, while German outfit Dortmund - renowned for their fine record at home - were expected to dispatch surprise package Malaga, following a goalless draw in their encounter in Spain.
However, Jose Mourinho's side, despite taking an early lead in Turkey, were stunned by three second half goals and when Alvaro Arbeloa was sent off a stunning turnaround seemed possible as Galatasaray were roared on by their famous home support.
But fortunately for the Spanish giants, Cristiano Ronaldo was on hand to smash in a second and end the host's chances.
Meanwhile, in Germany, Dortmund were trailing Malaga 2-1 as the clock hit 90 minutes.
The hosts had been far from their flowing best and seemed on course to be the latest side to succumb to Manuel Pellegrini's team - but remarkably struck the double they needed to progress.
Malaga were incensed by Felipe Santana's last-gasp tap-in, which appeared to be from an offside position, but the goal was given and Dortmund will join Real in the final four.
Here's what our Sky Sports experts made of the action:
Galatasaray 3-2 Real Madrid (agg: 3-5)
Matt Le Tissier: Galatasaray gave it a pretty good go. When the early goal went in we thought it was pretty much game over but the three goals in the second half shook things up; there were still 18 minutes to go and they only needed two more. But Real Madrid then showed a great deal of composure and Galatasaray didn't really create too many clear cut chances towards the end.
I certainly think Real are still contenders for the title. They still looked dangerous but perhaps switched off a bit when they were 4-0 up on aggregate. When they came out for the second half they took their foot off the gas a bit but when they needed to defend a bit better at the end they did and then went up the other end and got another goal.
Ray Wilkins: Real were probably guilty of thinking it was game over at 4-0 on aggregate but you have to give Galatasaray credit as well. They were playing in front of a very fervent crowd and they gave it a good shot. They just didn't have enough in the end but it was a great comeback.
I always thought it would be tough for Real going to Turkey; it's not an easy place to go. They love their football and once they're on top of you they can make it uncomfortable. But the two goals Ronaldo scored were exquisite. He's Mourinho's go-to man; he plays nearly every minute of every game and week after week he delivers the goods.
Borussia Dortmund 3-2 Malaga (agg: 3-2)
Wilkins: Malaga played a really good tactical game, totally against their way of playing normally. Defensively they were outstanding - although Dortmund missed a few chances - and their goalkeeper, Willy Caballero, made a couple of blinding saves.
However, for the winner the fifth official must be able to see the offside. There was also an offside for Malaga's second goal - what are these fifth and sixth officials doing? But that won't be the only decision they get wrong in the Champions League this season, so you just have to get on with it. Dortmund have not played well but they fought like tigers and have gone through.
Didi Hamann: For all the beautiful play we know Dortmund are capable of, their character and desire got them through the game and got them the two late goals. After 40 minutes of very sloppy play and not getting any rhythm going there was a moment of magic by Marco Reus in the build up to their first goal. The finish by Robert Lewandowski you can watch all night - it gets better every time you see it. The flick over the keeper and finish before the full-back challenges him is top class.
Karl-Heinz Riedle: The winner was a clear offside goal and it shouldn't have been the winner for Dortmund - even from the first cross there were four players offside. But this is the game and Malaga will be really disappointed. Their keeper, Willy, was the man of the match; he saved so many top chances for Dortmund. He was really on fire.