Lionel Messi scored on three dazzling runs for his second international hat trick, finishing the season with a record 82 goals for club and country and giving Argentina to a 4-3 win over South American rival Brazil in an exhibition game Saturday.

With Brazil using a mostly young roster ahead of the Olympics, Romulo put the five-time world champions ahead in the 23rd minute. Messi gave Argentina a 2-1 lead with goals in the 31st and 34th on spectacular dashes that beat the defense, but Oscar tied the score in the 56th and Hulk tapped in a corner kick dropped by goalkeeper Sergio Romero in the 72nd.

Argentina came back once again three minutes later when Frederico Fernandez scored off a corner kick by Sergio Aguero, who had just entered the game.

Then in the 84th, Messi picked up the ball at midfield, dribbled and unleashed a left-footed shot from 21 yards that went in just under the crossbar, delighting a sellout crowd of 81,994 at MetLife Stadium.

Messi scored 73 goals in 60 games this season for Barcelona, breaking the previous European club record of 67 goals set by Bayern Munich's Gerd Mueller in 1972-73 and the world club record of 70 by Archie Stark of Bethlehem Steel in the American Soccer League in 1924-25. Messi had nine goals in nine games for Argentina in the same span, raising his career total to 26 in 70 appearances. His first hat trick for Argentina was at Switzerland on Feb. 29.

While this was Messi's last formal match of the season, he has an upcoming charity game in Burkina Faso on June 16 and an all-star exhibition at Miami seven days later.

There were nearly more late goals in the entertaining, wide-open match, Fernandez cleared a shot by Brazilian star Neymar off the goal line in the 81st. Goalkeeper Rafael Cabral made a diving stop on Messi's 22-yard free kick in the 84th.

There was pushing and shoving in injury time, when Argentina's Ezequiel Lavezzi and Brazil's Marcelo received red cards.

Bruno Ivini, a 21-year-old central defender, made his first international start following two substitute appearances in recent weeks. He took the place of Thiago Silva, who strained a thigh muscle last Sunday in Brazil's 2-0 exhibition loss to Mexico in Arlington, Texas.

Manchester United's Rafael da Silva started at right back instead of Danilo.

Argentina made one change from the lineup that routed Ecuador 4-0 in a World Cup qualifier last weekend, starting Jose Sosa instead of Aguero.