Cristiano Ronaldo came off the bench to inspire Portugal to a win over Andorra that keeps their hopes of automatic World Cup qualification alive.
With Group B leaders Switzerland beating Hungary 5-2, Portugal needed victory to set up a final-day showdown with the Swiss.
Ronaldo, on at half-time, drove home after the hour, with Andre Silva sealing the points from close range.
Portugal will qualify as group winners if they beat Switzerland on Tuesday.
Switzerland will travel to Portugal with a three-point advantage, but Portugal have a better goal difference.
Ronaldo is one booking away from a suspension and that perhaps influenced the decision of coach Fernando Santos to start with the Real Madrid forward on the bench.
If Portugal fail to win on Tuesday, they will enter the play-offs, while Switzerland, who have nine wins from nine matches, need only a point to qualify.