Dortmund had it all to do after losing the first leg 3-0 in Spain but last season's runners-up looked on course to stage a remarkable comeback when, after seeing Madrid winger Angel Di Maria miss an early penalty, they scored twice through Marco Reus during a first-half onslaught.
The German side continued to throw everything at Madrid in the second half, hitting the woodwork and going close on a number of other occasions, but they could not find the third goal they needed as Carlo Ancelotti's men held on for a 3-2 aggregate win.
Dortmund beat Madrid 4-1 at home in last season's semi-finals but they needed an even better result this time following the first-leg loss.
However, they welcomed back the four-goal hero of last year's match as Robert Lewandowski returned after suspension, while in a further boost for the hosts Madrid star Cristiano Ronaldo was only named on the bench after missing the weekend league match with a knee problem.
That gave Dortmund a lift before kick-off, but any optimism in the home camp should have been extinguished in the 16th minute when Madrid won a penalty after Fabio Coentrao's cross struck the arm of Lukasz Piszczek.
In the absence of regular taker Ronaldo, Di Maria stepped up for the penalty but he slipped just as he shot and saw his effort well saved by Roman Weidenfeller diving to his left.
An away goal then would surely have ended the tie as a contest, leaving Dortmund needing to score at least five times to go through, but the miss further galvanised the home side and they laid siege to the Madrid goal for the remainder of the half.
The unmarked Henrikh Mkhitaryan should have scored in the 19th minute when he side-footed wide following good work by Lewandowski, but within five minutes they were ahead thanks to a combination of Reus and a terrible error from Pepe.
The Portugal centre-back's attempted back header was pounced on by Reus and he nipped it past Iker Casillas before sliding it into the net.
That set the Westfalenstadion rocking, and it was to get a whole lot better for the home side before the break as well.
Casillas did well to tip over Mats Hummels' powerful header at the far post in the 32nd minute but Dortmund would not be denied and they made it 2-0 in the 37th minute.
Another mistake from the visitors saw Asier Illarramendi carelessly give the ball away to Reus, who raced to the edge of the Madrid area before slipping in Lewandowski. Casillas tipped the Poland international's shot onto the post but Reus followed up to slam the loose ball into the roof of the net.
Nine-time European champions Madrid, previously unbeaten in this season's competition, were on the ropes and the half-time whistle could not come soon enough for the Spanish giants.
Fortunately for them it arrived without any more setbacks, and at the interval Ancelotti decided to shake things up, sending on attacking midfielder Isco on for the more defensive-minded Illarramendi.
The break seemed to take the steam out of Dortmund somewhat, and Madrid looked the more likely scorers at the start of the second half with Gareth Bale and Karim Benzema both threatening.
However, in the 64th minute the visitors survived a huge let off when Mkhitaryan missed an unbelievable chance.
The Armenia international looked to have done the hard work as he raced onto Reus' through-ball and rounded Casillas but, with the goal at his mercy, he shot against the near post.
Dortmund had found their second wind though and in the next six minutes Casillas was called on to make to crucial saves to deny Mkhitaryan and Kevin Grosskreutz.
Jurgen Klopp's men would not come any closer than that to leave Madrid breathing a huge sigh of relief at the final whistle.