The Boston Red Sox have designated? Hanley Ramirez for assignment to clear a roster spot for second baseman Dustin Pedroia, who has been activated from the disabled list, the team announced Friday.

Ramirez, 34, has more than $15 million left on his contract this season. The Red Sox will have to pay that money unless they find a trade partner in the next seven days. If not, they will have to release the veteran.

Ramirez has an option on his contract worth $22 million for 2019 that would vest if he reaches 497 plate appearances this season. He has 195 plate appearances so far this season.?If the Red Sox release him, the vesting option will no longer be in play.

He is hitting .254 with six home runs and 29 RBIs this season, starting 25 games at first base and 19 at designated hitter.

Ramirez signed a four-year, $88 million contract with the Red Sox in 2014. His best season since returning to the team that signed him out of the Dominican Republic in 2000 came in 2016, when he hit .286 with 30 home runs and a career-best 111 RBIs.

A three-time All-Star and the 2006 National League Rookie of the Year with the Florida Marlins, Ramirez has a .290 career batting average with 269 home runs and 909 RBIs in 14 seasons with the Red Sox, Marlins and Los Angeles Dodgers.

Pedroia, 34, began the season on the disabled list recovering from left knee surgery performed in October.