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

Harvey announced his retirement Friday, posting a photo of himself on Instagram from a 2013 game with the Mets. He captioned the post, «goodbye baseball. And thanks.»

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 up 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, incredibly much.

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

«To all my teammates and organizations who took me in: I fought to win and to fight with you more than you will ever know.

«To the fans, most importantly to the NY Mets fans – they made a dream come true for me. A dream I could never have thought to come true. Who could have thought that a kid from Mystic, CT could play in the best ?city in the world, your hometown. You are forever embedded in my heart.»

Harvey was drafted by the Mets with the seventh overall pick in 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 borough of the borough of Queens in 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 a 6.27 ERA.

He spent last season in Baltimore’s minor league system and was suspended for 60 games at the start of the 2022 season for «engaging 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

Baltimore Orioles starting pitcher Matt Harvey #32 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 supplying pitcher Tyler Skaggs with 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 he gave Skaggs counterfeit oxycodone pills, which also contained fentanyl.

CLICK HERE TO GET THE FOX NEWS APP

During the trial, Harvey «admitted, while under immunity from criminal conviction, that he was a cocaine and oxycodone user and that he occasionally provided 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 in the bottom of the third inning during the World Baseball Classic Group 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 classicgoing 1-0 with a 1.29 ERA in two starts.

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

Fox News’ Ryan Gaydos contributed to this report.