Megan Rapinoe will play her final match for the United States in a friendly against South Africa on 24 September.
Rapinoe has played in four World Cups, winning the 2015 and 2019 editions.
Before the 2023 World Cup, she confirmed plans to retire when the National Women's Soccer League (NWSL) season ends in November.
"When I think back on the past 30-plus years of playing this game, my overriding emotions are joy and gratitude," Rapinoe said.
"It's been an unbelievable ride. It will be special to have this one last opportunity to play for my country and get the chance to thank my teammates and everyone who has had an impact on me as a person and player over the years."
The 2019 Ballon d'Or winner has made 203 appearances for the USA, scoring 63 goals, and also helped her country win gold at the 2012 Olympics in London.
The 38-year-old was one of three American players to miss a penalty when they were knocked out of the 2023 World Cup by Sweden in the last 16, which was thought to have been her final international appearance.
But the USA will now play South Africa in two friendlies on 21 September and 24 September, the second of which will occur at Soldier Field in Chicago and is being billed as Rapinoe's "farewell game".
The forward is scheduled to sign off her professional career on 15 October when NWSL side OL Reign play their final game of the season at Chicago Red Stars.