Jesse Ylonen scored the go-ahead goal with 10 minutes remaining and the Montreal Canadiens beat the San Jose Sharks 3-1 on Tuesday night.

Kaiden Guhle and Christian Dvorak also scored in the third period for the Canadiens, and Jake Allen made 38 saves for his 14th win.

“[Allen] was unreal again. He’s been really good this whole season. And again tonight, he played a big part in that we won this game,” Ylonen said.

San Jose defenceman Jacob MacDonald scored his first goal of the season and first for the Sharks. Kaapo Kahkonen stopped 29 shots in his 13th loss.

MacDonald scored 1:43 into the first period. Sharks forward Nico Sturm caused a turnover in front of the Montreal net, allowing MacDonald to sneak in and tuck home the puck.

“Our guys had a great forecheck. (The) puck just popped out to a good spot, and I put it home," MacDonald said.

At 8:07 of the third, Guhle wound up and took a big slap shot for his third goal of the season. The defenceman beat Kahkonen through the legs, tying it 1-1.

“I thought we were too loose. Even in the first two periods, we had some chances to go up 2-0 and just couldn’t capitalize. I thought our defenceman reads were giving up odd-man rushes," Sharks coach David Quinn said. "We were just too loose at the end of the day. When you give up a 2-on-0 basically to lose the game, that’s just not really having a conscience and not reading the situation.”

Less than two minutes later, Canadiens forward Rem Pitlick broke in, creating a 2-on-0, and fed Ylonen at the mouth of the net for his second goal of the season at 9:59.

“Well, I know that Pitlick is a really good player, and he can see those plays. So I actually was expecting the puck to come, and it was a great play by him. It was easy to score from there," Ylonen said.

Dvorak, who also assisted on Ylonen's goal, added an empty-netter with five seconds left for his 10th goal this season.

"I didn’t mind our first two periods. I just felt we were leaving a lot on the table because we just weren’t quite executing. We talked between the second and third that, you know, we need the third to be our best period of the night, and it was,” Canadiens coach Martin St. Louis said.