Real Madrid will go through as group winners to the Champions League last 16 after Toni Kroos and Marco Asensio each scored in a 2-0 win over Inter Milan on Tuesday.
A comfortable victory at the Santiago Bernabeu, aided by Nicolo Barella's red card in the 64th minute when Inter were one goal down, sent Madrid through top of Group D, five points ahead of the Italians, who advance as runners-up.
Madrid's reward is a guarantee they will avoid the likes of Liverpool, Bayern Munich and Manchester City when the draw for the knock-out stages is made on Monday, although Lionel Messi's Paris Saint-Germain will be among those in the runners-up pot.
"We wanted to finish first in the group to avoid the stronger teams and we've done that," said Luka Modric.
Other than the shock defeat away at Sheriff in September, Madrid's group stage has been relative plain-sailing, with five wins, including two victories over Inter.
But the challenge now for Carlo Ancelotti's team will be to show they can still mix it with the very best in the latter stages, after they were outplayed last season by Chelsea in the semi-finals.
Karim Benzema was absent after picking up an injury against Real Sociedad on Saturday and while Luka Jovic filled in, Madrid will hope to have Benzema back for the derby at home to Atletico Madrid in La Liga on Sunday.
- Fine start for Ancelotti -
Madrid are already eight points clear in Spain and, together with their impressive showing in the Champions League, it has been an accomplished first few months for new coach Ancelotti.
Inter were the sharper team early on, popping the ball around Madrid, whose best chances came on the break.
Inter went closest when Marcelo Brozovic sent a dipping effort onto the roof of the net.
Madrid, though, grew into the game, with Luka Modric and Kroos increasingly influential in midfield.
Vinicius Junior looked dangerous but lacked the composure that Kroos then showed for the opener in the 17th minute.
Casemiro dummied a pass from the right, allowing Kroos to collect and while he wanted the shot on his right foot he reluctantly took it on his left, driving straight and hard into the far corner.
The goal knocked the confidence out of Inter, who were on the back foot for the rest of the half.
Vinicius wanted a penalty but fell too easily and then fluffed a four against three on the counter.
Jovic was slid through but fired wide and Rodrygo twice went close, one shot on the turn clipping the post before another hit the side-netting.
After half-time, Inter's Barella blazed over from inside the box and then just after the hour, he was sent off.
Barella was barged out of play and into the sideboards by Eder Militao and he reacted by swinging his right hand into Militao's left leg while on the ground. Militao earned a yellow card for the resulting confrontation and Barella saw red.
That killed any hope Inter had of a comeback and all that was left was for Asensio, on as a substitute, to add Madrid's second in the 79th minute with a wonderful curving shot that flew in off the post.