A draw or a loss would have left Portugal in the play-offs but an own goal from Johan Djourou and a goal from Andre Silva took Portugal through.
France beat Belarus 2-1 to win Group A, with Sweden finishing second despite losing 2-0 to the Netherlands.
The Dutch, who finished third in the 2014 World Cup, are eliminated.
They needed a seven-goal win to nudge Sweden out of the play-offs and scored two first-half goals through Arjen Robben, but it was not enough.
In Group H, Greece ensured their place in the play-offs with a 4-0 win over Gibraltar.
Belgium had already won that group and thrashed Cyprus 4-0 with Chelsea’s Eden Hazard scoring twice, and further goals from his brother Thorgan and one late on from Manchester United striker Romelu Lukaku.
The European teams to qualify for the World Cup so far are France, Portugal, Germany, Serbia, Poland, England, Spain, Belgium and Iceland.
There are four more European places up for grabs, with eight nations – Sweden, Switzerland, Northern Ireland, Republic of Ireland, Denmark, Italy, Greece and Croatia – taking part in two-legged play-offs.
Four of the teams will be seeded, and they will be confirmed when the next Fifa world rankings are announced next week.
Slovakia, who finished below England and above Scotland in Group F, are the side to miss out on the play-offs as they are the second-placed side with the worst record.