The trade was announced after the AL East Red Sox lost 13-1 to Toronto at Fenway Park. Boston is 1 1/2 games ahead of Tampa Bay.
The big league trade deadline is 4 p.m. Friday. Earlier Thursday, the Nationals sent Brad Hand closer to Toronto.
Schwarber had just completed a historic jump-off when he stretched his right hamstrings on July 2. The left-handed batter has been on the injured list since then and has been unable to play after winning his first All-Star selection.
The 28-year-old outfielder got off to a great start in his first season with Washington, scoring 25 homers with 53 RBIs in 72 games.
Schwarber tied a major league record hitting 12 home runs in 10 games from June 19-29. He also set a record for a first hitter for home runs in a month, logging in 15 times to start games in June.
Schwarber joined the Nationals this year after six years with the Chicago Cubs. In 2016, he only played two regular season games after a serious knee injury, then returned to help the Cubs win the World Series by going 7 for 17 (0.412) in five games.
The Red Sox sent right-hander Aldo Ramirez to Washington. Ramirez, 20, was 1-1 with a 2.03 ERA in eight starts for Low-A Salem.
To make room for Schwarber, the Red Sox have nominated right-hander Brandon Workman for assignment.
Workman, 32, has a combined double with a 5.46 ERA in 29 games with the Cubs and Boston this season.