World champions France won 1-0 at title holders Portugal to claim the first berth at next year's Nations League finals.
Chelsea midfielder N'Golo Kante poked home the winner in Lisbon on 54 minutes after Anthony Martial, who was starting for the injured Kylian Mbappe, had wasted several earlier chances for Les Bleus.
"Given the quality of the opposition, it's of course one of our best performances of recent times," France coach Didier Deschamps said.
"We deserved the win and we've fulfilled our objective of finishing top. I'm very proud of the players. They proved tonight that France are still a great team."
France are three points clear of European champions Portugal in Group A3 with one game left and can not be caught because they have won the head-to-head.
In the other group game, goals from Dejan Kulusevski and Marcus Danielsson snapped Sweden's four-game losing streak in the competition as they beat Croatia 2-1 in Stockholm.
Needing a win to avoid relegation from Group A3, the victory keeps the Swede's survival hopes alive as they head into their final group game against France in Paris on Wednesday.
In Germany, Timo Werner struck twice and Leroy Sane got the other as the hosts cancelled out a surprise 12th minute goal to beat Ukraine 3-1.
"It is fun to play in the former home stadium and to win. It looked quite good up front and we are also getting better at the back," former RB Leipzig striker Werner said of his return to the city for the first time since leaving for Chelsea.
Captain Manuel Neuer won his 95th cap to equal Sepp Meier's long-standing appearance record for German goalkeepers.
Germany are now top of Group A4 on nine points and with Spain held 1-1 in Switzerland, the Germans are now one point ahead of them and only need a draw in their final meeting Tuesday in Seville to join France at the 2021 finals.
The Swiss took the lead on 25 minutes through Remo Freuler at St Jakob-Park in Basel but after Sergio Ramos missed two penalties in his European-record 177th cap, Spain equalised in the 89th courtesy of substitute Gerard Moreno.
"Ramos hadn't missed in 25 tries," Spain coach Luis Enrique said of his captain's penalties.
"Football has these moments. If there had been a third penalty, he would have taken it as well. And a fourth, and a fifth."
"We deserved to win for our first half performance and for how we played in the second."
Elsewhere in lower tiers, 10-man San Marino held Group D2 leaders Gibraltar to a 0-0 draw for their second point in a row after losing 39 matches before.
Luxembourg and the Faroe Islands also failed to clinch promotion into the next highest league with one game to spare, with Luxembourg losing 2-1 in Cyprus in Group C1 and the Faroes held 1-1 in Latvia in Group D1.
The fifth matchday is completed Sunday with games including Belgium versus England and Italy at home to Poland.