BOSTON - Justin Masterson and the Boston Red Sox have agreed to a $9.5 million, one-year contract.

The team announced the signing of the free agent on Thursday night. He can make an additional $2.5 million in performance bonuses: $500,000 each for 185 innings and each additional five through 205.

Masterson made 25 starts for Cleveland and St. Louis last season, going a combined 7-9 with a 5.88 ERA.

Masterson, an All-Star in 2013, was drafted by the Red Sox in 2006. He went 9-8 with a 3.76 ERA for Boston from 2008-09 before he was traded to the Indians in a deal that brought Victor Martinez to Fenway Park.

In all, the 29-year-old Masterson is 60-72 with a 4.24 ERA over seven major league seasons and 1-0 with a 1.54 ERA in the post-season.

The Red Sox have been trying to rebuild their rotation after trading four-fifths of it away last summer en route to a last-place finish in the AL East. They acquired righty Rick Porcello from the Tigers earlier Thursday and were also in talks to obtain lefty Wade Miley from Arizona.