Cristiano Ronaldo became the first player to score in every Champions League group stage match as Real Madrid beat Borussia Dortmund 3-2 at the Bernabeu. Ronaldo also finished as the group stage’s top scorer for a sixth time, taking his tally for the season to nine.

The holders, who finish as runners-up in Group H behind Tottenham, were set on their way by Borja Mayoral’s first goal in the competition, set up by Ronaldo, who quickly added a second himself.

His strike ensured he found the back of the net in all six group games before Pierre-Emerick Aubameyang struck either side of half-time to unexpectedly level things up. Lucas Vázquez’s late goal inflicted another defeat on Dortmund, who hung on to third place in the group to qualify for the Europa League.

Napoli’s faint hopes of qualifying at Shakhtar Donetsk’s expense were ended after a 2-1 defeat at Feyenoord, coupled with Shakhtar’s famous win against Manchester City. Nicolai Jorgensen headed Feyenoord level after Piotr Zielinski had volleyed Napoli into an early lead and Jerry St Juste headed the Dutch side’s winner in added time, after they had Tonny Vilhena sent off for his second bookable offence.

In Group G, Besiktas, who had already qualified as winners, won 2-1 in Germany against RB Leipzig thanks to Talisca’s stoppage-time winner.

Porto secured the win they needed to book the second qualifying spot in Group G by beating Monaco 5-2. Both sides were reduced to 10 men before half-time when the Porto defender Felipe was dismissed for his foul on the Monaco midfielder Rachid Ghezzal, who was also shown a straight red card for retaliating.

Liverpool’s Group E rivals Sevilla also progressed after drawing 1-1 away to Maribor, where Marcos Tavares’ header was cancelled out by Sevilla’s Ganso.