Borussia punishes wasteful Madrid
Marcel Schmelzer's 64th-minute strike proved to be the winner for the Bundesliga champions. Cristiano Ronaldo had pulled Madrid level two minutes after Robert Lewandowski opened the scoring in the 36th.
It was Dortmund's first win at home over a Spanish opponent at the sixth attempt, while Madrid has now lost 17 of its 24 games in Germany against a German opponent. Madrid's only win was a 3-2 win at Bayer Leverkusen in 2000.
Dortmund tops Group D with seven points after three games. Madrid remains a point behind with two wins. Ajax beat Manchester City 3-1 in the other group game to move into third.
Early nerves from the home side allowed Madrid - playing its 350th European Cup game - to make the better start. A Marco Reus mistake allowed Ronaldo through but Mesut Oezil was unable to reach the winger's cross with the goal at his mercy in the fifth.
Sebastian Kehl tested Iker Casillas with Dortmund's first shot in the 13th. The two players were the only survivors from the sides' last meeting in February 2003.
Sami Khedira was forced off by injury in the 20th, forcing Madrid coach Jose Mourinho to bring on the more offensive Luka Modric in his place.
Dortmund enjoyed greater freedom in Khedira's absence and Mario Goetze laid the ball back for Kehl to bring a fingertip save from Casillas.
The home side deservedly scored when Kehl intercepted Pepe's poor clearance and sent Lewandowski through to shoot inside the right post.
Ronaldo provided the immediate response with his fifth goal of the campaign, allowing Oezil's ball over the top to bounce once before lifting it over Roman Weidenfeller with a deft chip.
Goetze should have scored after the break when Lukasz Piszczek cut the ball back but he placed his shot too close to Casillas.
Then the Spain goalkeeper was again alert to prevent Reus surprising him with a free kick to the near post.
Angel di Maria shot narrowly wide on a rare Madrid attack, but Goetze's influence was growing and it seemed just a matter of time before the home side found the breakthrough.
It came when Casillas' punched clearance from Goetze's cross landed kindly for Schmelzer to tuck inside the far post.
Modric and Oezil were denied by last-ditch defending as Madrid sought a response. Makeshift left back Michael Essien might have salvaged a draw but failed to direct his header on target in the final minute.