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.

Red Sox president Dave Dombrowski said Ramirez's vesting option did not factor into the Red Sox's decision.

Dombrowski said the team informed Ramirez of the move early Friday morning. Ramirez tweeted a farewell to Red Sox fans on Friday afternoon.

Thank you #RedSoxNation. It's been real. Love you always🙏🏽 — Hanley Ramirez ⚾️ (@HanleyRamirez) May 25, 2018

Dombrowski told reporters that manager Alex Cora suggested the move to designate Ramirez. Cora wanted to play Mitch Moreland more at first base going forward, and the Red Sox didn't think Ramirez would be effective as a bench player.

"We were prepared to maybe go in a different direction with our move. [Cora] called me around 11:30 [Thursday] morning," Dombrowski said at a Friday news conference. "I was about to go for a run, and Alex goes, 'I've got a thought for you about what we're doing,' and he said, 'This is a move I would like to make.'"

"I was a little bit surprised," Dombrowski said. "I wouldn't say shocked, but I would say surprised."

Cora acknowledged that it was his decision and thanked Dombrowski for trusting him.

"For how good of a player he is, it was going to be difficult," Cora said of Ramirez coming off the bench. "It was probably platoon, maybe come in and pinch hit late in games. And that's not the perfect role for Hanley Ramirez. He's a guy that needs his at-bats."

Ramirez 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. He was not in the lineup Friday, but is starting and batting sixth Saturday against the Atlanta Braves.

"I'm very, very excited," Pedroia said. "It's been a long time, so it's going to be fun getting out there and playing."

The Associated Press contributed to this report.