EDMONTON, Alberta (AP) — Charlie McAvoy scored in overtime to lift Boston to a 6-5 victory over the Edmonton Oilers on Wednesday night after the Bruins blew a three-goal lead.

McAvoy sent a backhand past Oilers goalie Stuart Skinner 3:10 into the extra period that started with Edmonton on the power play.

Boston gave up leads of 4-1 and 5-4 in the game.

"I just loved the way we kept forging ahead. We didn't worry about what happened positively or negatively," Bruins head coach Jim Montgomery said.

"I thought we continued to play. Obviously they had a great push by a great team in the third period and it kind of snowballed, but we went right back to work afterwards. When they made it 4-4, the next four minutes I thought we controlled the game and started to push back."

Morgan Geekie, Brad Marchand, Trent Frederic, Jake DeBrusk and David Pastrnak also scored for the Bruins, who had lost four straight before winning their last two. Mason Lohrei had three assists and Jeremy Swayman made 37 saves.

"I think that's an identity of ours," Swayman said. "It was not exactly how we drew it up, but it was really special to get those two points and the way we did it through adversity and their push, I think that's really something special for our group moving forward."

Warren Foegele had a pair of goals and Mattias Janmark, Corey Perry and Zach Hyman also scored for the Oilers, who had won eight in a row at home. Skinner stopped 30 shots.

"You are happy with the way you battled back from down 4-1 to a really good team, to be able to come back twice and earn a point says a lot about our team and how it faces adversity," Hyman said.

"But at the same time you don't want to put yourselves in that position. Since we have been back (from the All-Star break) we have put ourselves in that position too often and we have to learn to play consistently throughout the whole game again."

Boston got a power-play goal just 2:34 into the opening period as Geekie picked the top corner with a long shot.

The Oilers tied the game with 8:20 to play in the first as Connor McDavid tipped a puck off a defender's stick off the boards to Foegele who drove hard to the net before slipping a backhand past Swayman. McDavid's assist extended his home point streak to 20 games.

The Bruins surged back in front just 25 seconds into the second period as Edmonton coughed up the puck and Marchand beat Skinner to the short side. Frederic redirected in Jesper Boqvist's shot just four minutes later for a two-goal lead.

DeBrusk made it 4-1 with six minutes left in the second, before Foegele scored his second a minute and a half later to make it 4-2 after two.

Janmark and Perry scored 1:10 apart in the third tie to it at 4.

Boston regained the lead with 7:19 left when Pastrnak scored his 36th of the season, but Edmonton tied it again on Zach Hyman's goal just 42 seconds later.

UP NEXT

Bruins: At Calgary on Thursday night.

Oilers: Host Minnesota on Friday night.