Napoli's Champions League campaign ended with a 2-1 loss to Feyenoord as they finished behind Manchester City and Shakhtar Donetsk in Group F.
Piotr Zielinski opened the scoring for Napoli early on, but Feyenoord equalised through Nikolai Jorgenson before Jeremiah St. Juste grabbed a late winner.
Real Madrid ended off on a high note in Group H with a 3-2 win over Dortmund.
The hosts took the lead through Borja Mayoral in the eighth minute before a stunning strike from Cristiano Ronaldo doubled their advantage four minutes later.
However Pierre-Emerick Aubameyang pulled a goal back shortly before half-time and equalised right after the break.
It took a late winner from Lucas Vázquez to seal the game for Real Madrid, who finished second in the group behind Tottenham. Third-placed Dortmund will play in the Europa League.
Liverpool finished top of Group E ahead of Sevilla, ending off with a 7-0 win over Spartak Moscow.
The Reds took an early lead through a Philippe Coutinho penalty. In the 15th minute, the Brazilian netted his second. Roberto Firmino then scored three minutes later.
Shortly after half-time, Sadio Mané made it 4-0 before Coutinho sealed his hat-trick.
Liverpool added two late goals to put the cherry on top. Mané scored his second before Mo Salah rounded off the rout.
Manchester City lost their first Champions League match this season as Shakhtar downed them 2-1.
City fell two goals behind in the first half due to strikes from Bernard and Ismaily. Sergio Aguero's stoppage time penalty in the second proved to be nothing more than consolation.
Pep Guardiola's side nevertheless finished top of Group F, with Shakhtar ending up second.
Tottenham finished off their successful group stage journey with a 3-0 win over APOEL.
Goals from Fernando Llorente and Heung-Min Son put Spurs 2-0 up going into the break. Georges-Kévin Nkoudou then sealed the game in the 80th minute.
FC Porto finished second in Group G behind Besiktas after beating Monaco 5-2.
The Portuguese side already led 3-0 at half-time thanks to two goals from Vincent Aboubakar and one from Yacine Brahimi.
Both sides had been reduced to 10 men after red cards for Felipe and Rachid Ghezzal.
Second half goals came from Kamil Glik and Radamel Falcao for Monaco and Alex Telles and Tiquinho Soares for Porto.
Other results:
Maribor 1-1 Sevilla
RB Leipzig 1-2 Besiktas