Argentina conceded after just 37 seconds in their must-win game against Ecuador – but Lionel Messi came to the rescue as his side booked their place at next summer’s World Cup with a 3-1 win.

The number 10 scored a brace in the first half in Quito and capped off a stellar performance as he completed his hat-trick with a stunning chip over keeper Maximo Banguera just after the hour mark. Romario Ibarra stunned the away fans – and perhaps all of South America – as he nodded on a ball lofted high into the danger area and sloppy defence from Argentina allowed the Ecuadorian space to slot it in past Sergio Romero in the opening minute.

But Messi, who is now the all-time leading goalscorer in South American qualifying, played a deft one-two with Angel di Maria to level things up after 12 minutes and then put his side in front eight minutes later with a strike from just inside the box.

Ecuador continued to press in search of an equaliser as Argentina failed to kill the game off, allowing the home side to attack well into the second half. But it was a moment of brilliance which proved to be the difference.

The Argentina talisman took the ball in space about 40 yards out from goal, weaved his way to the edge of the box and was able to lob Banguera – six yards off his line – as he lost his balance and fell to the floor.

Argentina were looking in danger of not making the 2018 World Cup in Russia going into the final group games, following a torrid campaign in which they had only scored 16 in 17 games.

Low points were numerous, and a 2-0 loss to Bolivia in March saw the end of Edgardo Bauza’s short stint as boss as Jorge Sampaoli took the reins. Since then, three draws put Argentina on the brink of not making the World Cup for the first time since 1970.

They travelled to Quito – a place where they have not won since 2001 – but bagged all three points to guarantee a trip to Russia.

Jorge Sampaoli has asked his Argentina players to step up and help Messi win the showpiece.

Speaking after the game, Sampaoli told a press conference: “I told the group: Messi did not owe the World Cup to Argentina, but football owed the World Cup to Messi. The nationality of the best player in the world is luckily Argentine.

“Football, the World Cup, could not be left (the same) without Messi. We had to play with that in mind. As a consequence of that pressure we are stronger now, this qualification will make us stronger to face the future.

“We had the possibility to help him to be in another World Cup. He is the best player in the history of soccer and I’m very excited to be in a group near him.”