(CNN) Carli Lloyd, who is one of the most successful players in the history of the United States Women's National Team (USWNT), is to retire from professional football.
Over an illustrious international career which began in 2005, Lloyd earned 312 caps -- the second all-time record in US and world history behind only Kristine Lilly (354) -- and scored 128 goals.
In a statement released by US Soccer, it was announced that the 39-year-old Lloyd will close out her international career with four friendly matches for the USWNT -- two in September and two in October -- which will serve as the 39-year-old's final games for the national team.
She will also complete the remainder of the National Women's Soccer League season with NJ/NY Gotham FC before hanging up her boots.
"When I first started out with the National Team in 2005, my two main goals were to be the most complete soccer player I could be and to help the team win championships." Lloyd said in a statement on Monday.
"Every single day I stepped out onto the field, I played as if it was my last game. I never wanted to take anything for granted, especially knowing how hard it is to get to the top, but even harder to stay at the top for so long."
Lloyd is one of only four international soccer players to play 300 or more times for her country.
Through her 312 caps under five different coaches, the USWNT has an overall record of 257-17-38, a winning percentage of 88%.
Lloyd appeared for the USA across three different decades, at four World Cups and in four Olympic Games.
She played in 25 World Cup matches and 22 Olympic matches, passing Lilly for the most games played by a USWNT player in world championship events.
Lloyd has won the FIFA Women's World Cup twice, as well as claiming two Olympic gold medals, most recently winning a bronze medal at the Tokyo 2020 Olympic Games after the USWNT beat Australia.
One of her crowning moments came in the 2015 World Cup final as she scored a hat-trick in the first half on the way to the USWNT's 5-2 victory over Japan. She would go on to win the Golden Ball as the best player in the tournament.
Lloyd played international matches with more than 100 different teammates, calling them "basically family over the years."
"The number of days we spend together on the road is more than the time we spend with our own families and significant others," she said.
"We have been able to share some unbelievable moments together on and off the field, and we've also shared some heartbreaking moments. I'm just thankful for both the highs and lows because that's what has helped us grow as people, players and as a team.
"I will always be thankful for the friendships I have formed along the way and the fact that I was able to play and compete with the best players in the world."
Lloyd had that uncanny knack of being able to raise her game when it really mattered, scoring in all three medal matches at the Olympics she played in.
She scored the game-winning goals in the gold medal match at the 2008 and 2012 Olympics while scoring twice against Australia in her final Olympic match earlier this month.
Her 128 career goals are fourth all-time in US history and tied for fifth all-time in world history.
"Through all the goals, the trophies, the medals and the championships won, what I am most proud of is that I've been able to stay unapologetically me," said Lloyd.
"My journey has been hard, but I can honestly say I've stayed true to myself, to my teammates, my coaches, the media and the fans throughout my entire career and that is what I am most proud of.
"Everyone sees the moments of glory, but I have cherished the work behind the scenes and the adversity that I've had to overcome to get to those glorious moments."
Visit CNN.com/sport for more news, features, and videos
Lloyd was twice named the US Soccer Female Player of the Year and was a two-time FIFA Women's Player of the Year.
Current USWNT head coach Vlatko Andonovski called Lloyd a "true legend."
"Her career was unique, and her success on the field is something all current and future National Team players should aspire to achieve. The way she approached her everyday training and career as a professional is truly impressive and I've been honored to coach her."