BOSTON — An experiment that sounded intriguing in the dead of winter melted in early spring and officially ended Thursday when Troy Tulowitzki announced his retirement from the Yankees and baseball.

The Yankees signed the 34-year-old shortstop Jan. 4 after the Blue Jays cut Tulowitzki in December despite owing him $34 million. Tulowitzki impressed the Yankees with his athleticism despite having missed all of the 2018 season because of bone-spur surgery on both heels. Tulowitzki also was limited to 66 games in 2017 due to ankle and hamstring injuries.

The Yankees saw enough in several winter workouts that they believed he could fill in at short until Didi Gregorius returned from Tommy John surgery sometime in June. Instead, Tulowitzki played in five games (four starts at short) and went on the injured list with a strained left calf on April 4. While working back from that problem and playing in minor league games, Tulowitzki reinjured his calf May 1 and after that returned to his home in Henderson, Nev., to contemplate his future.

Many believed he was done playing, and that was confirmed Thursday. Tulowitzki later accepted a job to be a volunteer assistant coach for the University of Texas baseball team.

“I will always look back with tremendous gratitude for having the privilege of playing as long as I did,’’ Tulowitzki said in a statement released by the Yankees. “There is no way to truly express my gratitude to the fans of Colorado, Toronto and New York. They always made my family and I feel so welcome.’’

Tulowitzki, a five-time All Star and two-time Gold Glove winner, grew up a Derek Jeter fan and wore the future Hall of Famer’s No. 2 while wanting to play for the Yankees.

“I want to thank the Yankees’ organization and [GM] Brian Cashman for giving me the opportunity to wear the Yankees’ uniform and live out another childhood dream,’’ Tulowitzki said. “I wish that my health had allowed for a different ending to that chapter.’’

In 13 big-league seasons. Tulowitzki batted .290 with a .856 OPS.

“He played shortstop with a flair. He looked at home playing shortstop,’’ Aaron Boone said of Tulowitzki, who the manager explained had an impact on the Yankees’ clubhouse even though he wasn’t around much after spring training. “Hopefully at some point we will get to see him.’’

Yankee reliever Adam Ottavino was a teammate of Tulowitzki’s with the Rockies and was disappointed to see him leave the game.

“Really tough. I know he worked hard the last few years to get healthy,” Ottavino said. “Probably really disappointing for a lot of people. He’s such a good player, and I know he was really looking forward to this year and giving it another go. I thought he would try until maybe he couldn’t anymore.

“Maybe that’s where he’s at. He looked good in spring training, I thought. He texted me right when I signed about how excited he was. I felt like maybe we were gonna have a good year. It ended quickly. I definitely wasn’t thinking about him retiring or anything like that.’’