Lionel Messi scored a superb hat-trick as Argentina came from behind to win away in Ecuador and qualify for the 2018 World Cup in Russia.
Brazil had already qualified and Luis Suarez scored twice as Uruguay beat Bolivia 4-2 to qualify, with Colombia also advancing with a 1-1 draw in Peru.
Peru finished fifth in South American qualifying and will now meet New Zealand in a two-legged play-off.
Arsenal’s Alexis Sanchez and Chile are out after losing 3-0 in Brazil.
Argentina began the day in sixth position and in danger of not qualifying for a World Cup for the first time since 1970.
They made a terrible start in the high-altitude location of Quito when the hosts went ahead after 38 seconds through Romario Ibarra’s goal – the quickest goal Argentina had ever conceded in a World Cup qualifier.
However Argentina, runners-up in Brazil in 2014, fought back with Messi – just when he was needed most – in stunning form.
The five-time world player of the year equalised after 12 minutes when he linked up with ex-Manchester United midfielder Angel di Maria and stabbed home.
His second goal came eight minutes later with a powerful strike from the edge of the area before a fine solo goal in the second half sealed the victory and with it Argentina’s passage to Russia next summer.
Disaster for Chile
Arsenal striker Alexis Sanchez will not be playing in the 2018 World Cup
Chile, who have won the last two Copa America tournaments, were aiming to qualify for their third successive World Cup after reaching the last 16 in 2010 and 2014.
They began the final round of matches in third place in the table, but fell behind to two Brazil goals in three second-half minutes from Paulinho and Gabriel Jesus.
With Peru scoring a late equaliser against Colombia, Chile needed to score to be in the play-offs and in injury-time, attacked with all of their players – including Manchester City goalkeeper Claudio Bravo – in the Brazil half.
However, the attack broke down, Brazil launched the ball forward and Jesus walked the ball into the net for his second with his City team-mate Bravo stranded to confirm Chile’s elimination.