Lisbon: Champions League holders Real Madrid secured a last-16 berth for the 20th successive season after an 87th-minute header by substitute Karim Benzema gave them a laboured 2-1 win at 10-man Sporting Lisbon in their Group F clash on Tuesday.
The result left Real second in the group on 11 points from five games, two behind Borussia Dortmund who crushed Legia Warsaw 8-4 to set a record for the most goals scored in a Champions League match.
Dortmund need a draw when they visit Real at the Bernabeu on Dec 7 to win the section. Sporting have three points and will clinch a consolation last-32 berth in the second-tier Europa League with a draw at Legia.
Real stretched their unbeaten run in all competitions to 30 games after a patchy performance in which their top scorer Cristiano Ronaldo, needing two goals to reach a 100-goal milestone in European club competition, was largely subdued.
France defender Rafael Varane fired Real ahead in the 29th minute but it took a late glancing header by Benzema to rescue them after Adrien Silva had equalised with a penalty after Joao Pereira's 64th-minute red card.
Varane drilled the ball home from six metres after Ronaldo unwittingly laid the ball into his path following an inviting cross by Luka Modric.
Needing a win to keep alive their own hopes of advancing, Sporting matched Real in every department for long spells but were up against it after Pereira was sent off following an altercation with Mateo Kovacic.
Their 80th-minute equaliser came out of the blue, with substitute Fabio Coentrao handling the ball while raising his arm to appeal for handball by Sporting forward Joel Campbell.
Real appeared to be heading for a draw -- and the group's runners-up spot -- after Silva blasted his spot kick past Keylor Navas, but Benzema made his presence count after coming on for Isco midway through the second half.
Just as Sporting pressed forward in search of a winner despite their numerical disadvantage, Benzema steered an inch-perfect cross by Sergio Ramos into the bottom right corner.