(CNN) -- Cristiano Ronaldo scored the winner as Real Madrid beat 10-man Manchester United 2-1 Tuesday to reach the quarterfinals of the Champions League 3-2 on aggregate after a pulsating match which turned on the controversial dismissal of Nani just before the hour mark.
United had just gone ahead on the night through a Sergio Ramos own goal when the Portugal midfielder attempted to control a high clearance from his defense.
But Nani's foot was high and his studs caught Real's Alvaro Arbeloa in his midriff as he moved forward to intercept the ball.
Turkish referee Cuneyt Cakır then stunned the Old Trafford by showing a red card to Nani as he recovered from the collision.
Manchester United manager Alex Ferguson charged down from his touchline seat to protest and as Nani eventually parted the field he was given a consolation pat by Real manager Jose Mourinho.
It was the cue for Real, who had offered little in attack until then, to press forward and the man advantage soon paid in the 66th minute.
Substitute Luka Modric found space outside the penalty box to unleash a curling and unstoppable shot past David de Gea, the highlight for sure of the Croatian's stuttering progress with the Madrid giants since his summer signing.
Two minutes later and United's worst nightmare was complete as old boy Ronaldo, relatively quiet until then, connected with Gonzalo Higuain's clever cross to score at the far post.
Ronaldo pointedly did not celebrate but his goal was decisive, meaning United had to score two more to progress.
They made a brave fist of it, Real goalkeeper Diego Lopez having to produce fine saves from Michael Carrick, Robin van Persie and Nemanja Vidic
Wayne Rooney, surprisingly left out of the United starting line up, also hooked a chance over, but at the other end fellow substitute Kaka rattled the home woodwork.
At the end it was Real who were celebrating but Mourinho showed some surprising modesty in victory.
"The best team lost, independent of the sending off," he told ITV Sport. "We didn't deserve to win and didn't play well."
Ferguson refused to attend the post-game press conference, because he had been left "very distraught" by Nani's dismissal, according to his assistant Mike Phelan.
"It was a great performance marred by the wrong decision," added Phelan.
Ronaldo had received a warm welcome from home fans on his return to Old Trafford, while Ferguson sprang a surprise with the omission of Rooney, giving starts to 39-year-old Ryan Giggs, playing his 1,000th game for club and country, Nani and Danny Welbeck.
It was Welbeck who shone in the opening half, with his darting runs causing the Real defense constant problems.
He nearly scored on the follow up as Vidic's header hit the post and was later denied by Lopez again.
The second half also started promisingly for United and it was Welbeck's flick which was deflected past Lopez by the unfortunate Spanish international Ramos in the 48th minute.
His goal won the El Clasico clash against Barcelona Saturday, but once Nani had departed it did not take long for his teammates to be celebrating again and their fine recent run continues.
In the night's other last 16 tie, Borussia Dortmund beat Shakhtar Donetsk 3-0 to progress 5-2 on aggregate.
After a 2-2 draw in Ukraine three weeks ago in the first leg, the German champions were always on top through goals by Felipe Santana, Mario Goetze and Jakub Blaszczykowski.
Dortmund coach Jurgen Klopp is bidding to emulate the achievement of the 1997 side who won the Champions League but is guarding against optimism.
"There are still lots of strong teams in the competition," he told gathered reporters "We are just delighted with the result and I am proud of the team."
"The whole Champions League campaign has gone like clockwork and this was an unbelievable 90 minutes from us."