Lyon clinched the final qualifying spot for the Champions League's knockout stage on Wednesday as Juventus, Manchester City and Bayern Munich secured top spot in their groups and likely an easier draw in the round of 16.

It was a night to forget for defending champion Real Madrid, which rested most of its regulars and lost 3-0 to CSKA Moscow at the Santiago Bernabeu for its heaviest home defeat in European competition. Madrid, which was jeered off the field, had already won its group and will be one of the seeded teams in Monday's draw.

Only one qualification place was up for grabs on the final night of group play and it was a straight shootout in freezing sleet between Lyon and Shakhtar Donetsk, which was forced to play its home game in Kiev after it was relocated due to martial law in various regions of Ukraine.

CSKA defender Georgi Schennikov celebrates after scoring his side's second goal during the Champions League, Group G soccer match between Real Madrid and CSKA Moscow, at the Santiago Bernabeu stadium in Madrid, Spain, Wednesday Dec. 12, 2018. (AP PhotoPaul White)

CSKA defender Georgi Schennikov celebrates after scoring his side's second goal during the Champions League, Group G soccer match between Real Madrid and CSKA Moscow, at the Santiago Bernabeu stadium in Madrid, Spain, Wednesday Dec. 12, 2018. (AP PhotoPaul White)

Nabil Fekir's 65th-minute goal earned Lyon a 1-1 draw that preserved second place in Group F behind Manchester City, which beat Hoffenheim 2-1 thanks to Leroy Sane's double to seal top spot.

Cristiano Ronaldo's Juventus also won its group despite a 2-1 loss at Young Boys. Manchester United could have jumped above Juventus with a win in Valencia, but Jose Mourinho's decision to rest several starters backfired in a 2-1 loss in Spain.

Bayern Munich's wild 3-3 draw at Ajax — featuring four goals from the 82nd minute, including an equalizer for Ajax five minutes into stoppage time — earned the German champion first place in Group E. Both teams had already qualified.

This was the first season when 16 group-stage places were guaranteed for the Big 4 leagues in Europe — Spain, England, Germany and Italy. The four countries put 12 teams in total into the round of 16, with all four of England's entrants advancing for the second straight season.

More AP soccer: https://apnews.com/apf-Soccer and https://twitter.com/AP_Sports

Steve Douglas is at www.twitter.com/sdouglas80