Schwarber, 28, is on the injured list with a right hamstring strain but is expected to be back within a week or so. He had a monster June before getting hurt, hitting 16 home runs that contributed to a 1.122 OPS for the month.
Schwarber is batting .253 with 25 home runs and 53 RBIs in 2021. He was named to his first All-Star team this year.
The Nationals are getting minor league right-handed pitcher Aldo Ramirez in return for Schwarber. Ramirez, 20, had a 2.03 ERA in eight games for Class A Salem. He is on the seven-day injured list.
Schwarber signed a one-year, $10 million deal with the Nationals after being non-tendered by the Chicago Cubs last season.
He has an $11.5 million mutual option for 2022 that includes a $3 million buyout. Schwarber should see time at designated hitter as well as the outfield for the Red Sox.
To make room for Schwarber on the 40-man roster, the Red Sox designated right-hander Brandon Workman for assignment.