Longtime Nationals star Ryan Zimmerman announced his retirement Tuesday, ending a decorated career in which he became the franchise leader in many major categories and boosted the team to its only World Series championship.

The veteran infielder issued a statement via CAA Baseball in which he thanked the Nationals' front office, managers and coaches, athletic trainers and medical staff, teammates, his agents and his family.

"When we first met I was a 20-year-old kid fresh out of the University of Virginia,'' he wrote. "I had no idea how unbelievable the next 17 years of my life were going to be.''

The Nationals took Zimmerman with their first pick in the 2005 draft (fourth overall) soon after the team moved from Montreal to Washington. He retires as the Nationals' career leader in games (1,799), runs  (963), hits (1,846), total bases (3,159), doubles (417), home runs (284) and RBIs (1,061).

A two-time All-Star, Zimmerman helped the franchise win its World Series championship in 2019. He had hits in 10 of the Nationals' 16 postseason games in 2019 and hit the first World Series home run in Nationals franchise history, in the second inning of Game 1 off Astros starting pitcher Gerrit Cole.

"Ryan will forever be Mr. National. From the walk-off home runs, to carrying the World Series trophy down Constitution Avenue, to the final day of the 2021 regular season when our fans gave him an ovation that none of us will soon forget, Ryan gave us all 17 years of amazing memories,'' team owner Mark Lerner said in a statement.

Zimmerman, 37, also was a two-time Silver Slugger winner (2009, 2010) and a Gold Glove winner ('09).

"For 17 seasons, Ryan Zimmerman epitomized what it meant to be the Face of the Franchise. He was an All-Star, Gold Glove and Silver Slugger winner, Comeback Player of the Year and World Series champion -- but those accolades pale in comparison to his impact on our organization and in the community during his career," general manager Mike Rizzo said in a statement. "Ryan always carried himself with class, honor and respect and played the game for the name on the front of the jersey, not the one on the back. I want to personally congratulate Ryan on a fantastic career and wish him and the entire Zimmerman family all the best in retirement."

He had 11 walk-off homers in his career and is one of only 10 players in major league history to have that many game-ending home runs, according to ESPN Stats & Information research. Eight of those players are in the Hall of Fame. Albert Pujols and Zimmerman are the only players on that list who played last season.

Zimmerman became the Nationals' third baseman in 2006 and stayed there full time through 2013. After spending time in the outfield and infield in 2014, he took over at first base in 2015.

Zimmerman spent 17 seasons total with the Nationals, but didn't play in 2020, choosing to sit out because of concerns about his family's health during the height of the COVID-19 pandemic. His mother has multiple sclerosis, and Zimmerman and his wife had their third child in 2020.

Zimmerman established the ziMS Foundation in 2006 to raise money and awareness for programs to help those with multiple sclerosis. The foundation has raised a total of $3.5 million.

"Although my baseball career has come to an end, my family and I will continue to be heavily involved in the DMV community,'' Zimmerman wrote in his retirement announcement.

"You have given so much to us over the past 17 years; it is now time for us to give back to you. We look forward to continuing many of our community programs and starting new ones in the future. Our kids will be raised here, as this is now our home, and we couldn't be more excited. So this is not a goodbye but more of a 'see you around,''' he said.

Zimmerman was nominated six times by the Nationals for the Roberto Clemente Award presented by Major League Baseball.

"Ryan's numbers and accomplishments speak for themselves, but the way he led by example and was respected not only in our clubhouse but around the game -- that is what I will remember most about his career,'' Nationals manager Dave Martinez said in a statement.

He hit .243 with 14 home runs and 46 RBIs last season and retires with a career batting average of .277.

The Associated Press contributed to this report.