MONTREAL -- Jesperi Kotkaniemi scored his first two NHL goals, and the Montreal Canadiens set an NHL record for the two fastest goals by one team in their 6-4 win against the Washington Capitals at Bell Centre on Thursday.

Montreal trailed 4-3 before scoring three times in the final 3:04.

Kotkaniemi tied it 4-4 with his second of the game. Max Domi gave Montreal (7-3-2) its third lead at 5-4 with 22 seconds left, and Joel Armia scored into an empty net from just inside the red line two seconds later to make it 6-4 and set the record.

[WATCH: All Capitals vs. Canadiens highlights]

"That was pretty crazy," Kotkaniemi, the No. 3 pick in the 2018 NHL Draft, said of the response he got from the fans. "I've never heard a crowd like that before."

Alex Ovechkin and Lars Eller each scored twice, and Braden Holtby made 38 saves for the Capitals (5-4-2). Ovechkin scored his ninth and 10th goals for his fourth two-goal game of the season.

Video: WSH@MTL: Domi, Armia set NHL record for fastest goals

"Obviously it's frustrating in the situation," Holtby said. "I think we had a chance to steal one there and just came up short. Luck seemed to be on our side for most of the third, and then it turned. We didn't do enough to push the other way."

At 18 years, 118 days, Kotkaniemi became the second-youngest player in Canadiens history to score his first NHL goal when he gave Montreal a 1-0 lead at 2:28 of the first in his 12th game. He beat Holtby to the short side from the left face-off circle off a pass from Armia.

Video: WSH@MTL: Kotkaniemi ties game with his second goal

Eller tied it at 1-1 at 6:16 on a rebound from the left circle.

Brendan Gallagher scored two goals 2:34 apart to give Montreal a 3-1 lead at 3:06 of the second.

Ovechkin (6:49) and Eller (7:59) scored goals 1:10 apart in the second to tie it 3-3.

Capitals defenseman Dmitry Orlov's shot from the point struck Ovechkin, and the puck floated over Price's left arm into the net to put Washington up 4-3 at 12:53.

Video: WSH@MTL: Ovechkin nets second goal on deflection

"That was a huge win," said Domi who scored to the far side from the top of the left circle off the rush. "It was a weird game. We came out of the gates flying, we let off the gas pedal a little bit. That's a veteran team that took full advantage of us kind of letting back a little bit, so to rally back as a group showed a lot of character. And to see the big guy here (Kotkaniemi) light it up twice was pretty special. That's the loudest I've heard a building in a long time.

"He's been unbelievable since the start of the year. He's had so many chances and he's a special player. He's going to be a really good player for a long, long time in this league and for this team. So we're very lucky to have him and excited to see how he's doing so well."

Carey Price made 27 saves for the Canadiens.

Video: WSH@MTL: Kotkaniemi beats Holtby for first NHL goal

They said it

"How we got back in the game was by putting pucks behind their defense and managing it properly. And then when we got ahead we tried to make something out of nothing occasionally, and they were able to transition. They're a quick team, they've got some dangerous offensive players and they made us pay." -- Capitals coach Todd Reirden

"I told Jesperi it's all about one goal, you know, get the monkey off your back and you will feel better. I think he played a great game, a huge two goals. Obviously we needed these two goals, too." -- Canadiens forward Tomas Tatar

Need to know

The previous NHL record for the fastest two goals by one team was three seconds. It was accomplished three times: by the New York Islanders against the Pittsburgh Penguins on Nov. 30, 2016; by the Minnesota Wild against the Chicago Blackhawks on Jan. 21, 2004; and by the St. Louis Eagles against the Detroit Red Wings on March 12, 1935. … Mario Tremblay was 18 years, 75 days old when he scored his first goal for Montreal on Nov. 16, 1974, against the New York Rangers.

What's next

Capitals: Host the Dallas Stars on Saturday (7 p.m. ET; NBCSWA, FS-SW, NHL.TV)

Canadiens: Host the Tampa Bay Lightning on Saturday (7 p.m. ET; SN360, CITY, TVAS, SUN, NHL.TV)

Video: Kotkaniemi, Domi lead Habs' comeback in 6-4 win