Peru will take on either the UAE or Australia for a place at the 2022 World Cup in Qatar after securing fifth place in the South American qualifying group with a a 2-0 win over Paraguay on Tuesday.
Brazil, Argentina, Ecuador and Uruguay had already secured South America’s four automatic spots.
As the two third-placed teams in Asian qualifying, the UAE and Australia will play each other in a play-off in Doha on June 7, with the winner progressing to face Peru, either on June 13 or 14.
"Tonight's game was a joy for the whole country but there is still one more step to take," Peru midfielder Christian Cueva said. "As from tomorrow we'll be focused on the playoff."
Peru also had to go through a playoff to reach the last World Cup in Russia, defeating New Zealand over two legs to qualify for their first finals since Spain in 1982.
On Tuesday, the Andean side started the night with 21 points, one more than Colombia and two ahead of Chile, knowing that a win over Paraguay in the final round of qualifying would be enough to wrap up the playoff spot.
They went ahead with just four minutes gone, Gianluca Lapadula running on to a defence-splitting pass from Cueva to poke the ball in off the post.
Three minutes before halftime it was 2-0, Cueva the architect again. His work outside a packed penalty box led to a cross finished off by Yoshimar Yotun.
The home side controlled the second half without making many more chances and were content to see the game out and send the capacity crowd at the National stadium into raptures at the final whistle.
Ricardo Gareca's team did not look like they would be in contention for Qatar early on in the group, only getting their first win in their sixth game. But three wins in a row against Bolivia, Venezuela and Colombia between November 2021 and January this year pulled them right back into the running.
“We’re very happy, we fought so hard,” said defender Renato Tapia. “We were in a really tight situation but we were able to pull ourselves out of it. Paraguay were a tough rival but we won."
In the night's other games, Brazil beat Bolivia 4-0 in La Paz thanks to goals from Lucas Paqueta, Bruno Guimaraes - his first for the national side - and a double for Richarlison.
The win took Brazil's points total to 45, a record in the South American qualifying section. Tite's men are unbeaten in their 17 group games so far, and they still have one match to play against Argentina.
Argentina drew 1-1 at Ecuador after Julian Alvarez's early goal was cancelled out in stoppage time by the home side's Enner Valencia, who converted the rebound after his penalty was saved.
That result extended Argentina's unbeaten run in all matches under Lionel Scaloni to a record-equalling 31. Alfio Basile led Argentina to 31 matches undefeated between 1991 and 1993.
Colombia beat Venezuela 1-0 thanks to a James Rodriguez penalty, while Luis Suarez, with a bicycle kick, and Federico Valverde gave Uruguay a 2-0 win over Chile in Santiago.