The 39-year-old converted a second-half penalty to score his 126th international goal in his 208th and final appearance for Argentina.
Messi also provided the assists for Nicolas Otamendi and Nico Paz as Argentina completed a comfortable victory at the Monumental Stadium.
More than 85,000 fans packed the stadium for Messi's farewell, with the Argentinian captain visibly emotional during the national anthem before kick-off.
A giant Argentina number 10 shirt carrying a thank-you message for Messi was displayed on the field, while the match was also briefly stopped in the 10th minute as supporters gave him a standing ovation.
Messi ends his Argentina career after more than two decades, having won the 2022 FIFA World Cup and the Copa America titles in 2021 and 2024.
He will continue playing at club level with Inter Miami.
