David Pastrnak had two goals and Jake DeBrusk also scored for the Bruins, who cashed in on a late opportunity when Washington's Nic Dowd was called for tripping with just 2:34 left in the third. DeBrusk set up McAvoy for a wrist shot from the slot that gave the Bruins the lead for good after Washington rallied from deficits of 2-1 and 3-2.
''I was pleased. Start to finish, I thought we dug in and played hard,'' Boston coach Bruce Cassidy said. ''It was a physical game. I thought we were the better team.''
The Bruins were coming off a 7-1 loss at home Tuesday night to the Carolina Hurricanes, who scored five goals in the first and put an emphatic end to Boston's five-game winning streak.
''I thought it was a resilient effort by us,'' McAvoy said. ''We showed good character.''
Erik Haula had two assists for Boston, and Linus Ullmark stopped 14 shots.
Evgeny Kuznetsov, Lars Eller and Nicklas Backstrom scored for Washington. Alex Ovechkin assisted on Kuznetsov's goal, extending his point streak to six straight games. Vitek Vanecek stopped 29 shots for the Capitals.
''It was a tight game. It was physical. It was battle-heavy,'' Washington coach Peter Laviolette said. ''But at the end of the day, it's tough we lose it in the last two minutes of the game.''
DeBrusk, who set up the winner with a pass to McAvoy in the slot, was credited with a goal 9:41 into the third period after the puck hit off Kuznetsov in front of the crease and got through Vanecek's pads, barely trickling over the goal line. There was no initial call and Bruins fans screamed until there was a stoppage for a video review, which confirmed the puck crossed the line. Patrice Bergeron was initially credited with the goal before an official scoring change after the game gave it to DeBrusk.
''He was flying. He was all over the ice,'' McAvoy said of DeBrusk. ''He was really pushing the pace. When he has his legs, he's a very dangerous player.''
Backstrom tied it again 36 seconds later with a wrist shot.
Kuznetsov beat Ullmark with a high wrist shot from the left circle 4:07 into the game. It was the first of just five shots the Capitals got on goal in the first period. Pastrnak answered for Boston 50 seconds later after dropping a pass back for Taylor Hall at the blue line for a quick pass right back to Pastrnak in the slot for a quick shot that tied it at 1.
Pastrnak got free on a breakaway and put Boston up 2-1 with a power-play goal 8:37 into the second period. Matt Grzelcyk set it up with a long pass from deep in the Boston zone to Pastrnak, who had gotten behind Washington's defense.
Eller jumped on a turnover at the blue line and got a wrist shot past Ullmark to tie it at 2 late in the second.
Backstrom said it's going to be difficult for the Capitals to win games with just 17 shots on goal.
''We've just got to start shooting a little bit more,'' Backstrom said. ''There was too much just passing it around.''
Bruins winger Brad Marchand appeared to injure his right shoulder in the second period when he was hit from behind into the boards by Garnet Hathaway, who was called for interference on the play. Marchand did not return. ... Boston's Anton Blidh needed a few minutes and a hand from a trainer to get back on his skates after getting leveled on a hit by Wilson with 4:33 left in the first. Blidh also did not return. ... The Capitals placed RW T.J. Oshie on injured reserve Thursday for an upper-body injury that had kept him out of the previous two games. Oshie will be eligible to return Monday when the Capitals host Vegas. ... Washington D John Carlson and F Conor Sheary remained in COVID-19 protocol and did not play. ... The Capitals were also without D Dmitry Orlov, who served the first of a two-game suspension for kneeing Winnipeg F Nikolaj Ehlers on Tuesday.
Capitals: Host the Ottawa Senators on Saturday.
Bruins: Host the Winnipeg Jets on Saturday.
More AP NHL: https://apnews.com/hub/NHL and https://twitter.com/AP-Sports
Copyright 2022 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.