BOSTON — Hanley Ramirez was designated for assignment by the Boston Red Sox, who are responsible for the $15.25 remaining on his contract but avoided him triggering a $22 million salary for 2019.

Boston made the move Friday to clear a roster spot for All-Star second baseman Dustin Pedroia, who was activated from the disabled list and was set to make his season debut against Atlanta after recovering from knee surgery.

The 34-year-old Ramirez was hitting .254 with six homers and 29 RBIs in 44 games this season while splitting his time between first base and designated hitter. He hit .163 with three homers and 12 RBIs in May after starting the season with a .330 average, three homers and 17 RBIs.

Ramirez signed an $88 million, four-year contract with the Red Sox as a free agent before the 2015 season, and Boston is responsible for the $15,258,065 still owed for this season. The deal contains a $22 million option that would become guaranteed if he has 1,050 plate appearances in 2017-18 combined and passed a physical at the end of the season. He already had 195 this season, leaving him 302 shy of triggering that provision.

Boston has seven days to trade Ramirez or release him. If he is released, he would have no opportunity to trigger the 2019 option.

An All-Star with the Florida Marlins from 2008-10, Ramirez batted .260 with 78 homers and 255 RBIs during his time with the Red Sox.

Pedroia, a four-time All-Star, had left knee surgery on Oct. 25 in which Dr. Riley Williams III restored cartilage, and the Red Sox said then he was expected to miss more than the first month of the season. Pedroia was 1 for 14 (.071) during a five-game injury rehabilitation assignment at Triple-A Pawtucket.

The 34-year-old Pedroia, a four-time All-Star, had been Boston's opening day second baseman every year from 2007-17. He was the AL Rookie of the Year in 2007 and Most Valuable Player in 2008.

Both of Boston's big free-agent signings ahead of the 2015 season have been designated for assignment. Third baseman Pablo Sandoval was given a $95 million, five-year deal and released last July 19. The Red Sox are responsible for the vast majority of Sandoval's $18 million salary this year, with the $545,000 he is earning from San Francisco offset against the total. Boston also owes Sandoval $18 million for 2019.