Longtime Rangers defenseman Dan Girardi announced his retirement Friday after 13 seasons in the NHL.

“I would like to thank all my coaches, family, friends and teammates for supporting me throughout my entire hockey career,” Girardi said in a statement released in conjunction with the Rangers. “I want to thank the New York Rangers for giving me a chance to fulfill my childhood dream of playing in the NHL. Throughout those 11 incredible years I have made so many friends on and off the ice. I bled Ranger blue and gave it my all for my team, the city and the Garden faithful.”

Girardi played 11 seasons with the Rangers, helping anchor the defense through 10 postseason appearances — including a trip to the Stanley Cup Final in 2014 and two other appearances in the Eastern Conference Final. The 35-year-old finishes his career with 46 goals and 184 assists in 927 games — and eight goals and 28 assists in 143 playoff games.

The undrafted defenseman earned his first contract with the Rangers during the 2005-06 season and made his NHL debut in January 2007. He went on to appear in more games than any other undrafted player in franchise history (754). Girardi served as alternate captain during his final three seasons with the team.

The Rangers bought out Girardi from the remaining three years of his contract in 2017 (they carry $3.611 million of dead cap space from that move this season, plus $1.11 million in each of the next three, through 2022-23). The following month, Girardi signed a two-year, $6 million deal with the Lightning.

“I also want to thank the Tampa Bay Lightning for helping me continue my career by giving me a chance to play for such an amazing organization, city and fan base,” Girardi said in the statement. “The last two years in Tampa Bay have been so much fun for me and my family. I will always fondly remember my time here.

“Finally, I want to thank my wife Pamela for always being there for me and holding down the fort and to Landon and Shaye for always being daddy’s number one fans.

“I gave my all every single night and left it all out on the ice. Now it’s time for the next chapter of my life to begin and I couldn’t be happier…and so is my body.”

With Brett Cyrgalis