Karim Benzema scored twice as Real Madrid overcame Borussia Monchengladbach 2-0 at the Alfredo Di Stefano Stadium to seal a Champions League last-16 spot
Group B was wide open heading into the final round of fixtures, but Benzema eased the growing tension on Zinedine Zidane with his 50th goal in the group stages of the competition from Lucas Vazquez's cross after just nine minutes
Gladbach were undone once more by the Frenchman before the interval as Benzema rose to meet Rodrygo's cross to double Real's advantage with another trademark header - and the hosts saw out the second period to cement top spot
That meant a winner in the other contest between Inter Milan and Shakhtar Donetsk would have sent Gladbach out - but the game ended in a 0-0 draw at the San Siro, sparking wild scenes of celebration among Marco Rose's players as news filtered back to Madrid
Zidane's side finished top with 10 points while Gladbach came second with eight, pipping third-placed Shakhtar due to their better head-to-head record, while Inter came fourth with six
Real's shock defeat to Shakhtar last week threatened their record of qualifying from their group for the last 23 years but as so often in the competition that forms such a large part of their identity, they stood tall when it mattered most
But this result was never really in doubt
 As early as the ninth minute, they were in front through Benzema as he was too strong for Matthias Ginter, rising to plant a header low to Yann Sommer's right and into the net
The visitors wasted a glorious chance to cancel out Benzema's opener when French winger Alassane Plea raced clear towards goal but bungled his attempted dink over Madrid goalkeeper Thibaut Courtois, sending the ball wide
Gladbach had scored 16 goals in their previous five matches but were mostly blunt in attack and barely troubled Courtois, with Plea also missing the target in the second half
Madrid, meanwhile, were hungry for more goals and should have stretched their lead
Luka Modric had a strike ruled out for offside late in the first half while Benzema saw a third header saved by Sommer and then smashed a shot off the underside of the bar, while Vazquez later struck the post
Once the final whistle went, Gladbach's players huddled around a smartphone to watch the final minutes of Inter's game against Shakhtar, erupting with joy when that match also finished to send them through by the skin of their teeth
Inter Milan were knocked out of the Champions League in the group stage for the third season in a row on Wednesday after being held to a 0-0 draw at home by Shakhtar Donetsk, who were also eliminated
Lautaro Martinez rattled the crossbar in the seventh minute of the Group B match but Inter created few chances after that, despite dominating possession at a soggy San Siro, and mustered only four efforts on target
Shakhtar finished level with Monchengladbach on eight points but lost out to the Bundesliga side on their head-to-head record to finish third and will go into the Europa League instead
Inter, who could have gone through with a win, finished bottom of the group with six points after drawing three of their six games and will not even have the consolation of the second-string competition
Inter, who thumped Shakhtar 5-0 in last season's Europa League semi-finals in August, needed to win to qualify and also to see the other match, between Real Madrid and Borussia Monchengladbach, not end in a draw
Martinez nearly got the early breakthrough they needed but his shot thumped against the crossbar from Nicolo Barella's cross
After that, Inter forced a succession of corners and tried their luck from long range but gave Shakhtar's 19-year-old goalkeeper Anatolii Trubin little to do
 Romelu Lukaku saw a header stopped by Trubin after the break before Shakhtar began to mount some attacks of their own
Tete, one of six Brazilian-born players in Shakhtar's starting line-up, tested Samir Handanovic with a fizzing long-range shot and Maycon sent the rebound over the bar
 Trubin pushed a Christian Eriksen drive out from under the bar in stoppage time as Inter's European season came to an underwhelming conclusion
Real Madrid boss : "We played a spectacular game from the first minute to the last
 We interpreted the game very well, I think it was the most complete performance of the season
"We don't just play well under pressure, we have played well in other games too but it's true that this team has this ability to come into their own when the going gets tough
"I've been a player and it's impossible to play like this all the time
 We try to but sometimes it doesn't come off
 I'm very happy for the players, because they are the most important members of this squad
"It was fundamental that we finished first, it's the first time that has happened since I've been coach
"Real Madrid host Atletico Madrid in La Liga on Saturday at 8pm while Borussia Monchengladbach are at home to Hertha Berlin on the same day in the Bundesliga; kick-off 2
30pm
The Champions League last-16 draw will take place at 11am on Monday, December 14 in Nyon
 You will be able to follow it across Sky Sports' platforms
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>
<PAD>