In Group B Portugal were victorious in the crunch top-of-the-table clash against Switzerland, winning 2-0 thanks to a glorious team goal and an own goal from their opponents.
But that was as good as it got for Dick Advocaat's side who follow failing to qualify for Euro 2016 by missing out on the World Cup finals for first time since 2002.
The breakthrough eventually came via an own-goal by the former Arsenal defender Johan Djourou just before halftime, and a goal from striker Andre Silva early in the second half was enough to wrap the game up for Portugal, who have won nine straight matches following their opening 2-0 loss to the Swiss a year ago.
Aside from a penalty shootout defeat by Chile at the Confederations Cup in June, the defeat by Switzerland was the only competitive game Portugal have lost since Fernando Santos took over as coach in September 2014.
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 Russian Federation. "I believed in the players and fortunately they gave me this present".
Switzerland then conceded an ugly goal in the 40th minute as a cross from Bernardo Silva was parried out by Sommer, only for the ball to bounce off Djourou and roll into the back of the net to make it 1-0. "The whole 90 minutes weren't ideal, but fortunately we won and we are going to Russian Federation".
The hosts took control after the break and scored again with a superbly-worked goal.
Swiss midfielder Granit Xhaka admitted that his side had not performed well enough.