Atlanta Braves pitcher Brandon McCarthy will retire at the end of this season, ending a 13-year career that has been plagued by injuries.

McCarthy, who has been out since June 24 with a knee injury, told MLB.com that he hopes to return to the Braves as a relief pitcher at some point this season.

"I'm done after this," McCarthy told MLB.com. "This is it. The offseason is the rest of my life. If I was going to keep playing, a month and a half ago, I would have had the surgery that cleans the [knee] and I'd be back next year just a little bit after spring [training]."

McCarthy, 35, said he is making a mechanical adjustment in his delivery to decrease the stress on his knee. The right-hander is 6-3 with a 4.92 ERA in 15 starts this season with the Braves.

McCarthy has battled multiple injuries to his shoulder and elbow throughout his career. He also had a major scare in 2012, when he was struck in the head by a line drive, suffering a skull fracture and an epidural hemorrhage.

McCarthy is 69-75 with a 4.20 ERA in 255 career games over parts of 13 seasons with the White Sox, Rangers, Athletics, Diamondbacks, Yankees, Dodgers and Braves.