In qualifying for the 2018 FIFA World Cup, Switzerland were drawn with Portugal, Hungary, Faroe Islands, Latvia and Andorra. The Swiss began their qualifying group with a shock 2–0 win over European champions Portugal, who had won the tournament less than two months prior to playing with them on 6 September. Afterwards, they beat Hungary 2–3, Andorra 2–1, Faroe Islands 2–0, Latvia 1–0 in the first five games, leading the group on maximum points. In the reverse fixtures, they beat Faroe Islands 2–0, Andorra 3–0, Latvia 3–0 and Hungary 5–2, before facing Portugal in the final group game, where they lost 2–0, meaning they would have to play in the play-offs; where they were ranked as the best second-placed team, and were drawn to play Northern Ireland. In the first leg, played on 9 November, they won 1–0 through a controversial penalty scored by Ricardo Rodríguez, and three days later played in the second leg, drawing 0–0 and advancing to the World Cup finals in Russia with a 1–0 aggregate win. Before the World Cup, Switzerland were ranked 6th in the world ranking, even ranking higher than eventual World Cup winners France.