NEW YORK (AP)The Red Sox will be responsible for paying Eric Hosmer only the major league minimum salary after acquiring him from the Padres.

As part of Tuesday’s trade, San Diego agreed to pay Boston up to $43,566,713, according to details of the agreement obtained by The Associated Press.

San Diego will pay $6,786,813 this year, which covers all but $246,154 of the $7,032,967 Hosmer is owed for the rest of this season. Hosmer has a $20 million salary, and 64 days were left in the 182-day season.

Hosmer has the right to opt out of the final three seasons of his $144 million, eight-year contract, a deal that has $13 million salaries in each of those years.

The trade includes $36.78 million in conditional cash if he keeps the contract: $12.28 million in 2023, $12.26 million in 2024 and $12.24 million in 2025. That leaves the Red Sox to pay $720,000 next year, $740,000 in 2024 and $760,000 in 2025, matching the major league minimum in each of those seasons.

Boston sent minor league left-hander Jay Groome to the Padres and also received a pair of minor leaguers: infielder Max Ferguson and outfielder Corey Rosier.

More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports