MANCHESTER, England — Cristiano Ronaldo scored the decisive goal in his return to Old Trafford, rallying Real Madrid over Manchester United 2-1 Tuesday night and into the Champions League quarterfinals with a 3-2 aggregate victory.

United took a 2-1 lead in the total-goal series when Nani’s cross in the 48th minute deflected in off a leg of Sergio Ramos for an own goal.

The game started to turn when Nani received a red card from Turkish referee Cuneyt Cakir in the 56th minute for a studs-up challenge on Alvaro Arbeloa. United manager Alex Ferguson charged out of his seat and down to the sideline to vent his anger.

Luka Modric cut to his right across the top of the penalty area in the 66th and tied the game and the aggregate with a 25-yard shot that eluded the left hand of diving goalkeeper David De Gea and went in off a post. It was just the second goal for Modric since Real Madrid bought him from Tottenham last summer.

Ronaldo scored three minutes later, getting past Rafael da Silva and sliding to tap in a cross from Gonzalo Higuain. Ronaldo, who did not celebrate on the field of his former club, reached 40 goals for the third consecutive season.

“I doubt that 11 against 11 we can win that match.” Real coach Jose Mourinho said.

Ronaldo starred for United from 2003-09, winning the FIFA Player of the Year award in 2008. United sold him to Real Madrid in June 2009 for 80 million pounds (then $131 million).

There were similarities to the last meeting of the clubs at Old Trafford, in the second leg of the quarterfinals in 2003. Brazil’s Ronaldo scored a hat trick that night as Real advanced on 6-5 aggregate with a 4-3 loss, and Ferguson dropped David Beckham from his starting lineup and brought the midfielder on in the 63rd minute. This time, Ferguson started Wayne Rooney on the bench, inserting England’s star forward only in the 73rd minute.

“We didn’t play well. We didn’t deserve to win,” Mourinho said.

Ryan Giggs, making his 1,000th senior competitive appearance for club, country and Olympic team, angrily pointed at Cakir after the final whistle and Rio Ferdinand sarcastically clapped in his face.

“Independent of that,” Mourinho said of the red card, “the best team lost.”

With Arsenal trailing Bayern Munich 3-1 going into the second leg in Germany next week, England is in danger of having no teams in the quarterfinals for the first time since 1995-96. Defending champion Chelsea and Manchester City were eliminated in the group stage.

In the night’s other match, Borussia Dortmund defeated Ukraine’s Shaktar Donetsk 3-0 to advance on 5-2 aggregate, getting goals from Felipe Santana in the 31st, Mario Goetze in the 37th and Jakub Blaszczykowski in the 59th.