Dramatic videos of Messi’s hat-trick leading Argentina to World Cup 2018
Messi was on target as Argentina came from 1-0 down to secure a 3-1 win against Ecuador in Quito.
The victory secured third spot in the South American qualifying group and automatic passage to Russia 2018.
Uruguay beat Bolivia 4-2 to guarantee second place, behind group winners Brazil, who defeated Chile 3-0.
That result meant Copa America champions Chile, who reached the final of the Confederations Cup in Russia in July, finished sixth in the group and missed out on a place at world football's showpiece event next summer.
Peru and Colombia drew 1-1 in Lima, meaning they finished fifth and fourth respectively. Colombia proceed directly to the World Cup, while Peru will need to negotiate an intercontinental play-off against New Zealand.