BOSTON – Clay Buchholz and the Boston Red Sox agreed to a four-year deal Sunday that keeps the All-Star pitcher under contract through 2015.

The deal also includes club options for 2016 and 2017. Buchholz gives up three potential arbitration years and delays his chance to become a free agent in exchange for the security of a long-term deal.

“I think that’s what every player wants,” the right-hander said. “You’re not going to play this game forever.”

Buchholz, 26, was second in the American League with a 2.33 ERA last year — the youngest Red Sox pitcher with an ERA that low since 1918. He was also among the league leaders with 17 wins.

“We think very highly of Clay or we wouldn’t be doing this,” Red Sox General Manager Theo Epstein said.