A year after winning the European Championship, Portugal has set its sights on another trophy after sealing its place at the 2018 World Cup with a 2-0 victory over Switzerland on Tuesday.
Cristiano Ronaldo's team got the win it needed in the showdown against the Swiss at a packed Stadium of Light.
Both teams finished with 27 points, but Euro 2016 winner Portugal had a better goal difference.
"Just like we did at the Euros, we are going to try to win the World Cup as well," Portugal midfielder Bernardo Silva said.
Switzerland, which had led Group B since the first round, will have to go through a playoff to try to make it to the tournament in Russia.
The Swiss arrived with a three-point lead over Portugal and needed at least a draw to earn the automatic World Cup berth.
"It was a game between two very good teams, it's not a surprise that we ended with the same number of points," Portugal midfielder Joao Mario said. "Fortunately, we were able to end up with the victory.It was well-deserved."
An own-goal by Swiss defender Johan Djourou before halftime and a goal by forward by Andre Silva early in the second half were enough to give Portugal its ninth straight victory since an opening 2-0 loss to the Swiss in Basel last year.
"We weren't perfect the entire 90 minutes," said Portugal coach Fernando Santos, who was celebrating his 63rd birthday on Tuesday. "But we got the win and made it to Russia. I always believed that we could do it. I had faith in my players and I'm glad that they gave me this gift today."
Switzerland had won all of its nine qualifiers until Tuesday's setback.
Portugal was in control but hadn't been able to create many scoring chances until Djourou found his own net while trying to clear a cross from the left by Eliseu in the 41st minute. The ball touched Djourou's right foot after getting past a defender and then Switzerland goalkeeper Yann Sommer.
Silva added to the lead in the 57th with a shot into the open net after picking up a cross from the right by Bernardo Silva.
It was only the second time Ronaldo failed to score in this qualifying campaign. The Real Madrid star ended with 15 goals, one less than Poland striker Robert Lewandowski, who scored a record-setting 16th on Sunday.
The result maintained Portugal's seven-game winning streak at home.
Among those in the crowd at the Stadium of Light was Madonna.
Hungary secured third place with a 1-0 win over the Faeroe Islands, with Daniel Bode scoring the winner in the 81st minute in Budapest.
Hungary ended with 13 points, 14 less than Portugal and Switzerland.
Despite the loss, fourth-place Faeroe Islands ended with its best qualifying campaign ever with nine points, two more than it achieved ahead of the 2002 World Cup.
AVOIDING LAST PLACE
Forward Valerijs Sabala scored a goal in each half to help Latvia defeat Andorra 4-0 in the match between teams at the bottom of the group.
The victory gave Latvia seven points, three more than last-place Andorra.
The result ended Latvia's seven-game losing streak in qualifiers at home.