Michael Cuddyer is retiring after playing 15 seasons in the major leagues, including his formative years with the Twins.

Cuddyer’s decision was confirmed to Newsday on Friday night. He would leave with one season left on a two-year, $21 million contract that he signed with the New York Mets as a free agent.

On Saturday, he tweeted, "I played baseball the way I did because I knew one day it would be over."

Cuddyer, 36, hit .259 with 10 home runs and 41 RBI during an injury-interrupted season with the Mets. He made his first World Series appearance this fall, striking out in all three of his at-bats.

Cuddyer began his career with the Twins, who selected him in the first round of the 1997 draft. In 2001, Cuddyer broke in as a 22-year-old and established himself as a key piece on a club that consistently pushed for postseason berths.

Cuddyer remained with the Twins until 2011, when he earned the first of two career All-Star selections.

On Saturday morning, the Twins tweeted to him, "Congratulations on a great career!"

He played three seasons with the Rockies beginning in 2012, winning the batting title by hitting .331 in 2013. He was again named an All-Star.

Cuddyer is a lifetime .277 hitter with the Twins, Rockies and Mets, with 197 home runs and 794 RBI.

Speculation about Cuddyer’s future cropped up on Friday night, when the transactions page on both Major League Baseball and the Mets’ website showed Cuddyer as retired.

The line was later deleted off both pages, which are maintained by MLB.

The retirement is a surprising move that will free up money for the Mets to spend this winter.

Cuddyer was due $12.5 million next season. It’s unclear exactly how much the Mets will get back from that total, though anything close to the full amount could be enough to alter the Mets’ free agency plans this winter.

Just two years removed from an All-Star Game nod, Cuddyer endured one of the worst seasons of his career in New York.

After signing a two-year deal worth $21 million — a signing that cost the Mets their first-round draft pick — he hit .259 with 10 home runs and 41 RBI. By season’s end, he was largely supplanted in left field by rookie Michael Conforto.

Despite his struggles on the field, Cuddyer lived up to his long-held reputation as a clubhouse leader as the Mets struggled to keep themselves in contention.