Cristiano Ronaldo has scored a penalty and an overhead kick as Portugal has beaten Poland 5-1 to guarantee a place in the Nations League quarterfinals.
Meanwhile, Scotland got its first win in nine games to keep alive its hopes of staying in the tournament's top tier.
Spain, which had already secured first place in Group A4, beat Denmark 2-1 in Copenhagen, and in the same group Serbia grabbed a late equaliser in Switzerland to condemn the Swiss to relegation into the second tier.
France, Italy, Germany, Spain and Portugal are all assured one of the eight quarterfinal spots. The games will be held from March 20-23.
The eight teams are also guaranteed a spot in Pot 1 for the qualifying draw for the 2026 World Cup.
Ronaldo sparkles
In Porto, Ronaldo turned in a man-of-the-match performance in a blistering second half.
Portugal took its time to overcome a hapless Poland but three goals in the final 10 minutes put the sheen on a commanding victory.
Rafael Leão broke the deadlock with a fine header 14 minutes into the second half and then Ronaldo got his 134th international goal from the penalty spot 13 minutes later.
Bruno Fernandes scored a stunning third from almost 30 metres out and 3 minutes later Ronaldo's pass gave Pedro Neto the space to lash home a fourth from a tight angle.
Ronaldo made it five — and 135 — with a deft overhead kick 3 minutes from time.
Although Dominik Marczuk got a late consolation for the Poles, the result ended its hopes of making the quarterfinals.
With Croatia going down in Glasgow, Roberto Martinez's men are guaranteed top spot in Group A1.
Scotland secure rare win
Scotland got its first win in nine games, with a late John McGinn goal giving the home side the slimmest of wins over a 10-man Croatia in Group A1.
Petar Sucic was harshly sent off for a second yellow card offence 2 minutes before half time but Scotland struggled to capitalise.
The 19-year-old Ben Doak shone for the home side during the second 45 minutes but it was not until 4 minutes from time that substitute McGinn broke the deadlock to the delight of the Hampden Park crowd.
The result left Scotland with two points and Poland with four. The teams meet in Warsaw on Monday with Scotland needing a win to avoid relegation to the second tier.
Spain beats Denmark
Denmark has not beaten Spain since 1993 and it got off to the worst possible start when Mikel Oyarzabal took advantage of poor defending to give the visitor the lead after 15 minutes.
The European champion was on top throughout, with Oyarzabal and Ayoze Pérez combining well up front.
Pérez hit the bar early on but got the goal his hard work deserved when he took a neat pass from Olmo and finished clinically with 58 minutes gone.
A shocking defensive lapse allowed Gustav Isaksen to nip in and score a late consolation for the Danes.
The result, combined with the draw in Switzerland, still leaves Denmark in pole position to grab one of the top two places in Group A4.
The Danes are in second place with seven points, two ahead of Serbia. The sides meet in Leskovac on Monday. Last-placed Switzerland will drop to League B.
Serbia equalises late
In Zurich, Zeki Amdouni put Switzerland ahead after 79 minutes and looked to be on course for its first win in the tournament.
But with 3 minutes left, Serbia broke upfield and Aleksa Terzić provided the coolest of finishes to level the scores.
Gregor Kobel saved a penalty from Serbia's Aleksandar Mitrović early in the second half.
AP