After nine MLB seasons, former New York Mets star pitcher Matt Harvey is calling it a career. 

Harvey announced his retirement on Friday, posting a photo of himself to Instagram from a 2013 game with the Mets. He captioned the post, "Goodbye, baseball. And thank you." 

Matt Harvey sits in the Mets dugout

New York starting pitcher Matt Harvey (33) looks on from the dugout during a game between Atlanta and New York on April 19, 2018, at SunTrust Park in Atlanta, GA.    (Rich von Biberstein/Icon Sportswire via Getty Images)

"To my family and friends: you kept me going and fighting, and gave me so much love along the way," Harvey wrote. "I may not have shown my appreciation at the time, but I appreciate each and every one of you, so incredibly much.

CARDINALS OFF TO WORST START IN 50 YEARS AFTER SUFFERING THREE-GAME SWEEP TO ANGELS

"To all of my teammates and organizations who welcomed me: I fought to win and to fight with you more than you will ever know.

"To the fans, most importantly the NY Mets fans: you made a dream come true for me. A dream I never could have thought to be true. Who could have thought a kid from Mystic, CT would be able to play in the greatest city in the world, his hometown. You are forever embedded in my heart." 

Harvey was drafted by the Mets with the seventh overall pick of the 2010 MLB Draft and made his debut in 2012. 

Matt Harvey pitches against the Phillies

Matt Harvey, #33 of the New York Mets, in action against the Philadelphia Phillies during a game at Citi Field on April 3, 2018, in the Flushing neighborhood of the Queens borough of New York City.  (Rich Schultz/Getty Images)

He was selected as an All-Star in 2013 and helped the Mets to a World Series appearance in 2015. 

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

Harvey last pitched in the majors for the Baltimore Orioles in 2021, finishing the season with a 6-14 record and an ERA of 6.27. 

He spent last season in Baltimore's minor league system and was suspended for 60 games at the start of the 2022 season for "participating in the distribution of a prohibited Drug of Abuse," which violated MLB’s drug program. 

His suspension was related to his testimony during the trial of Los Angeles Angels communications director Eric Kay.

Matt Harvey pitches for the Orioles

Starting pitcher Matt Harvey #32 of the Baltimore Orioles throws to a Kansas City Royals batter at Oriole Park at Camden Yards on September 8, 2021 in Baltimore, Maryland.  (Rob Carr/Getty Images)

Kay was convicted in February 2022 of providing pitcher Tyler Skaggs the drugs that caused him to overdose and die. He was convicted of drug distribution resulting in death and drug conspiracy after the government alleged that he gave Skaggs counterfeit oxycodone pills, which also contained fentanyl.

CLICK HERE TO GET THE FOX NEWS APP

During the trial, Harvey "acknowledged while under immunity from criminal conviction to being a cocaine and oxycodone user and occasionally providing Skaggs with oxycodone pills when he played for the Angels in 2019," according to ESPN.

Matt Harvey pitches in the World Baseball Classic

Matt Harvey, #43 of Team Italy, reacts after pitching at the bottom of the 3rd inning during the World Baseball Classic Pool A game between Italy and Cuba at Taichung Intercontinental Baseball Stadium on March 9, 2023, in Taichung, Taiwan.  (Yung Chuan Yang/Getty Images)

Harvey last pitched for Team Italy in the World Baseball Classic, going 1-0 with a 1.29 ERA in two starts. 

Harvey ends his career with a 50-66 record and an ERA of 3.66. 

Fox News’ Ryan Gaydos contributed to this report.