Lloyd holds the trophy after the USWNT defeated Japan in the 2015 World Cup final. (Mike Hewitt - FIFA/FIFA via Getty Images)

Carli Lloyd’s storied career with the United States women’s national team is coming to an end.

The star striker announced her retirement from soccer on Monday after 17 years with the national team. The USWNT’s four friendlies this fall will serve as her final games in a U.S. uniform. She will also play the remainder of the NWSL season with her club team, Gotham FC.

Lloyd, 39, ends her career with 312 caps, the second-most in USWNT history, and 128 international goals.

“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,” she said in a press release 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 played for five different coaches and with multiple generations of teammates during her time with the national team. She won two World Cups, two Olympic gold medals and two FIFA Player of the Year awards.

One of Lloyd’s most memorable performances came in 2015, when she became the first player ever to score three goals in a Women’s World Cup final. She scored the hat trick within the first 17 minutes of play, and the U.S. defeated Japan 5-2.

“Carli Lloyd is a true legend,” said USWNT coach Vlatko Andonovski. “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.”

“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,” Lloyd said. “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.”