The 36-year-old captain scored from a free-kick in the 78th minute to give Argentina a 1-0 win against Ecuador in the first round of South American World Cup qualifying on Thursday.
It was Messi's 104th goal in 176 international appearances, including his 29th in World Cup qualifying. Those 29 goals equal the record of Luis Suárez of Uruguay.
More than 83,000 fans at the nearly full Monumental de Nuñez Stadium were getting jittery until Messi scored, with their team having hit the post and the bar during the match, and offering Ecuador several chances to counter.
Ecuador kept Argentina at bay during most of the match with a defensive line of five players, led by Moisés Caicedo, which put Messi under wraps during most of the clash in Buenos Aires. But the decisive moment of the star was enough to beat the hard-working Ecuadorians.
Goalkeeper Hernán Galíndez did not move as Messi's shot from the edge of the box went to the back of the net, near the left post.
Argentina coach Lionel Scaloni, who completed five years in the job on Thursday, surprised fans with a different formation from the one that played and won the World Cup final over France in Qatar. He benched Ángel Di María and started Nicolás González.
Scaloni also used Lautaro Martínez as his centre forward instead of Julián Álvarez. Argentina's coach, who is yet to lose a match in South American qualifying, brought Di María in during the second half, but Argentina continued to struggle to get clear chances.
"Every match needs 100 per cent from us in this qualifying," Messi said after the match. "This was a tough match to play, a very physical one."
Earlier, Colombia beat Venezuela 1-0 with a header by Rafael Santos Borré in the 46th minute. Paraguay and Peru drew 0-0.
Argentina and Colombia lead the standings with three points. Paraguay and Peru are next with one.
Ecuador have minus three points because of a FIFA punishment that caused a deduction in South American qualifying for the falsification of birth information of defender Byron Castillo, who is of Colombian origin.
The first round of South American qualifying will be completed on Friday when Brazil host Bolivia and Uruguay play Chile.
All 10 teams in the region will play their second round on Tuesday.
The 2026 edition of the World Cup in the United States, Mexico and Canada is expanding to a 48-team format. The leading six positions in South America will secure a direct spot. The seventh-place team will contest an intercontinental playoff for a berth.