MIAMI — Steven Matz’s pain-filled season is officially over. The Mets confirmed that the lefthander will undergo left elbow surgery to remove a bone spur next week, though his injured shoulder will not require an operation.

That Matz will dodge shoulder surgery, first reported by Newsday, was perhaps the only positive development in what has been a slowly unfolding saga for the Long Island native. He had not pitched since Aug. 14 because of an impingement in his left shoulder, and it had long been assumed that time had run out for a comeback this season.

advertisement | advertise on newsday

Still, with a starting rotation that has been crushed by injuries, the Mets had held out hope that he might return. The lefty even endured a protracted comeback effort that ultimately resulted in a series of setbacks.

Matz had pitched through a painful bone spur that became public in June, though he had known about the injury for at least a month before the Mets announced it. The Mets knew even then that the lefty would need offseason surgery to address the issue.

Matz, 25, finished the season 9-8 with a 3.40 ERA in 22 starts. But once again, his work was curtailed by injuries, a constant theme since the Mets drafted him in the second round out of Ward Melville High School in 2009.

In addition to Matt Harvey and Jacob deGrom, Matz becomes the third Mets starting pitcher on the Opening Day roster to be sidelined with a season-ending injury. Zack Wheeler, who had been expected to return from Tommy John surgery after the All-Star break, also did not pitch in the majors this year.