Madrid: Real Madrid, who had already sealed a place in the last 16 of the Champions League, ensured top spot in Group A with a remarkable 4-3 win over Shakhtar Donetsk on Wednesday.
Cristiano Ronaldo scored after 18 and 70 minutes while Luka Modric (50) and Dani Carvajal (52) also struck to put the 10-time European champions in complete command on a freezing night in western Ukraine.
The temperature then soared quickly, on the field at least, as Shakhtar netted three times in the closing stages.
Brazilian midfielder Alex Teixeira converted a penalty after 77 minutes before Dentinho chested the ball into the net from a corner.
Teixeira was again on target with an elegant drive in the 88th minute as the hosts gave Real a huge fright.
Real have 13 points from five matches, three ahead of Paris St Germain who also qualified by beating Malmo 5-0 in Sweden.
PSG are sure to finish second because they have an inferior head to head record against Real. Shakhtar and Malmo both have three points.
Ronaldo opened the scoring with a header and grabbed his second goal of the night on the rebound after his initial attempt was blocked by a defender.
The Portugal forward also played a part in the other two goals by the visitors before Shakhtar came storming back as Real conceded their first goals in this year's competition.
Mario Mandzukic shrugged off his poor recent form to score the goal that sent last year's runners-up Juventus into the Champions League round of 16 with a 1-0 win over Manchester City.
The Croatia forward struck in the 18th minute, just after Fernandinho had missed a golden opportunity for the visitors who had already made sure of their place in the knockout stage.
In a match which only sporadically burst into life, Stefano Sturaro hit the post for Juventus and Raheem Sterling squandered another excellent chance for City 10 minutes from time.
Juventus completed a double over the English Premier League side, who had already qualified from Group D after winning their previous three games.
The Serie A champions, still unbeaten after five games, now top the group with 11 points and visit Sevilla in their final match.
Juve coach Massimiliano Allegri, who has frustrated supporters by frequently leaving out forward Paulo Dybala, picked the Argentine alongside Mandzukic in attack, although fans would have rather seen him partner Alvaro Morata.
"I made the decision to field Mandzukic a couple of days ago, we needed a player with his characteristics," Allegri said in a touchline television interview. "This is the most difficult group in the Champions and the lads have done well."
Mandzukic answered his critics in the 18th minute when Alex Sandro sent over a cross from the left and the Croatia forward held off Nicolas Otamendi's challenge to volley the ball in from close range.
The goal came just after Fernandinho had fired over from close range when he had the whole Juventus goal to aim at.
With Paul Pogba in inspired form in midfield for Juventus, Mandzukic then forced a good save from Joe Hart who also blocked an effort from Stephan Lichtsteiner after the Swiss had burst down the right.
Morata came on for Mandzukic in the 54th minute and almost immediately set up a second.
The Spaniard burst clear and lifted his effort over Joe Hart, but wide of the goal and Sturaro hit the post from point-blank range as he tried to prod it in.
Hart made another good save to deny Dybala after he got free, then Sterling failed to score from close range with Juve goalkeeper Gianluigi Buffon caught off balance.
Sevilla, beaten 4-2 at Borussia Moenchengladbach, must beat Juventus in their last game and hope the Germans lose to City so they finish third in the group and go into the Europa League.
(With inputs from Agencies)