BOSTON (AP) — Rafael Devers has agreed to an 11-year contract worth $331 million to stay with the Boston Red Sox, a person with knowledge of the agreement told The Associated Press on Wednesday.

The person spoke on condition of anonymity because the team had not announced the deal.

Locking up Devers, a two-time All-Star third baseman, was an important move for the Red Sox and their uneasy fans after All-Star shortstop Xander Bogaerts, slugger J.D. Martinez and pitcher Nathan Eovaldi departed in free agency.

The 26-year-old Devers reached the new deal a day after he and the team agreed to a one-year, $17.5 million contract to avoid arbitration in his final season under club control.

Devers’ 11-year deal is the longest commitment this offseason by the Red Sox and Chief Baseball Officer Chaim Bloom, supplanting the five-year, $90 million contract signed by Japanese star Masataka Yoshida.

Devers was the AL’s starting All-Star third baseman each of the past two years. In 141 games last season, he batted .295 with 42 doubles, 27 home runs and 88 RBIs.

The Red Sox are trying to bounce back from a 2022 season in which they finished 78-84, last in the ultra-competitive AL East. A year earlier, they won 92 games and reached the ALCS.

___

AP MLB: https://apnews.com/hub/mlb and https://twitter.com/AP_Sports