Cristiano Ronaldo created more history with his goal scoring exploits on a night that saw Liverpool, Manchester City and Tottenham advance to the Champions League knock-out stages.
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.
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 for his ninth in the Champions League this season.
Pierre-Emerick Aubameyang struck either side of half-time to unexpectedly level things up but Vazquez's late goal inflicted another defeat on Dortmund, who hung on to third place in the group to qualify for the Europa League.
Liverpool's 7-0 drubbing of Spartak Moscow means five Premier League teams made it through to the last 16 of the competition for the first time.
Jurgen Klopp's Reds finished top of Group E after their crushing Anfield success, while Tottenham beat Apoel Nicosia 3-0 to top Group H.
Man City, who had already progressed as Group F winners, lost their 100 per cent record with a 2-1 loss away to Shakhtar Donetsk.
Man United finished top of Group A on Tuesday night, while Chelsea finished second behind Group C winners Roma on goal difference.
On a night when 33 goals were scored in eight games, Philippe Coutinho fired a hat-trick as Liverpool - who needed at least a point to be sure of qualifying or a win to finish top - led 3-0 at half-time.
Group E rivals Sevilla also progressed after drawing 1-1 away to Maribor, where Marcos Tavares' header was cancelled out by Sevilla's Ganso.
City made seven changes to their starting line-up and were 2-0 down at the interval after goals from the Ukraine side's Bernard and Ismaily.
Substitute Sergio Aguero converted City's stoppage-time consolation from the penalty spot after Fred's foul on Brahim Diaz.
Shakhtar's victory and Napoli's 2-1 defeat to Feyenoord means the Ukrainians qualified in second place.
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.
Spurs won their fifth match in Group H with a comfortable victory at Wembley against Apoel.
Fernando Llorente and Son Heung-min were on target in the first half and Georges Nkoudou scored his first goal for the Londoners late on.
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.
Naby Keita had cancelled out Alvaro Negredo's early penalty for the Turkish side, while Leipzig midfielder Stefan Ilsanker was dismissed in the 82nd minute for his second yellow card.
Porto secured the win they needed to book the second qualifying spot in Group G by beating Monaco 5-2.
Vincent Aboubakar's first-half double and Yacine Brahimi gave Porto a 3-0 half-time lead before Kamil Glik pulled one back for Monaco from the penalty spot.
Nicolao Alex Telles struck the home side's fourth and Tiquinho headed a late fifth after Radamel Falcao had made it 4-2.
Both sides were reduced to 10 men before half-time when Porto defender Felipe was dismissed for his foul on Monaco midfielder Rachid Ghezzal, who was also shown a straight red card for retaliating.