When it really mattered and when the pressure was most intense, Lionel Messi delivered for Argentina.

On the brink of being eliminated from World Cup qualifying for the first time in almost five decades, Messi scored all three goals in Argentina’s comeback 3-1 victory Tuesday at Ecuador - overcoming the thin air in the Andes.

“It would’ve been crazy if Argentina didn’t play the World Cup,” Messi said. “This is what we came for. And on top of that we started behind. Luckily, we could react quickly and take the lead.”

Messi said the Argentina squad “will change, will grow a lot, will be stronger after this.”

But there’s still work to do for Argentina, the two-time champions who lost the final three years ago to Germany 1-0.

Messi has yet to hoist a major trophy for his country of birth, a contrast to the laurels he’s brought Barcelona.

He’ll turn 31 during the World Cup in Russia, so this may be his last chance.

“Messi does not owe Argentina a World Cup, but rather football owes him a World Cup,” Argentine coach Jorge Sampaoli said.

The top four teams in South America get automatic spots at next year’s tournament in Russia. Brazil has 41 points and clinched months ago. The other three advancing Tuesday went in this order: Uruguay (31), Argentina (28) and Colombia (27).

Peru (26) placed fifth and will keep alive its bid for a first World Cup appearance since 1982 after edging Chile for the South American spot in the inter-continental playoff next month against Oceania representative New Zealand.

On a dramatic last day of continental qualifying tournaments, six South American teams - separated by only four points over 17 matches - had shots at the World Cup entering play.

Chile, after a 3-0 loss to Brazil, and Paraguay missed out. Venezuela, Bolivia and Ecuador were already out of contention.

There was a major shock further north in the Americas with the U.S. slipping from third spot to fifth in CONCACAF qualifying for teams in North and Central America and the Caribbean with a loss in Trinidad and missing out on the World Cup. Panama secured the third automatic direct entry behind Mexico and Costa Rica, and Honduras finished fourth and secured a spot in a playoff against Australia.

___

3 TIMES MESSI

It looked easy for Argentina. But it wasn’t, particularly after Romario Ibarra gave Ecuador a 1-0 lead in the first minute at 2,850 meters (9,350 feet) in Ecuador’s capital.

“Even with a goal against us you could see the certainty of a team that knew how to play the game,” Sampaoli said.

Messi scored off a pass from Di Maria in the 12th, left-footing home from close range. In the 20th, Di Maria slipped a pass through to Messi, who drove the ball into the top corner from 15 yards.

Messi got his third in the 62nd, weighting a perfect 18-yard shot that went in just over the fingers of Ecuador keeper Maximo Banguera.

Argentina had scored only one goal in its last four qualifying games, and only 16 in 17 qualifiers entering the final.

“I won’t make any promises,” said Sampaoli, the third coach in this qualifying cycle for Argentina. The Argentine was successful as Chile’s coach, and at Spanish club Sevilla.

He also knows he had a little edge - a short guy named Messi, or “La Pulga” in Spanish - the flea.

“The nationality of the best player in the world is luckily Argentine,” he said.

___

COLOMBIA AND PERU

Colombia advanced with a 1-1 draw in Lima, Peru. The result also put Peru into a playoff in November with New Zealand for a spot in Russia.

James Rodriguez gave Colombia a 1-0 lead in the 56th, but Peru’s Paolo Guerrero equalized in the 76th to give Peru a chance.

“We’re fifth,” so we get the playoff,” Guerrero said. “We could have done a bit more, but the big thing we can think of is the playoff.”

___

CHILE OUT

Two-time defending South American champion Chile needed to win to get its third straight World Cup berth, but Brazil wrecked that with a 3-0 victory.

Peru’s 1-1 draw also removed any chance of Chile slipping in.

Gabriel Jesus scored twice and Paulinho got the other. It was the 12th consecutive unbeaten qualifying game since Tite has been in charge of the Brazilian team. He took over more than a year ago from Dunga.

___

URUGUAY SET

Uruguay was a cinch to advance. It did with style, beating Bolivia 4-2. Luis Suarez scored twice with the other goals coming from Martin Caceres and Edinson Cavani.