Argentina superstar Lionel Messi announced his retirement from international soccer on Monday, ending 21 years of national-team duty that were capped by winning the World Cup in 2022 to secure his place in the pantheon of the game's greatest ever players.

“It was a decision that hurt — and still hurts deeply — but I understand that the time has come,” the 39-year-old Messi said on his Instagram account.

Messi, who will continue to play at club level with Inter Miami in Major League Soccer, played in a record-tying six World Cups. He won it four years ago in a tournament he dominated in Qatar and also led Argentina to the title match in 2014 and again this year, when the Albiceleste lost to Spain in extra time in New Jersey.

Messi stands shoulder to shoulder with Diego Maradona, a compatriot with whom he was so often compared, and Brazil icon Pelé as the greatest players of all time.

“I swear to you that I always gave it my all — not just in these last few years when we won everything, but before that too," Messi wrote. "I always fought and left everything on the field for this jersey, to bring you joy and make you feel proud to be Argentine through football.”