Auston Matthews scored the game-winner with 30.2 seconds left in the third period to propel the Maple Leafs to a 3-2 win at Little Caesar’s Arena in Detroit on Sunday night.

Curtis McElhinney earned the win in goal, playing in his customary role as the starter on the second night of back-to-back games for Toronto. The victory came 24 hours after the team’s 5-3 loss in Pittsburgh.

“We’ve had a lot of really good chances but the puck just didn’t go in,” Matthews said to reporters of his play alongside William Nylander over the past two games. “But it’s nice to kind of finish it off there with a minute left and be able to win the game.”

The Leafs scored twice in a span of 18 seconds in the second period. James van Riemsdyk deflected a point shot from Jake Gardiner to get Toronto on the board. Then Mitch Marner, showing an extreme amount of patience, out-waited netminder Petr Mrazek before sniping his 14th marker of the season.

A defensive breakdown in the third period led to Detroit’s tying goal by Henrik Zetterberg, who was left uncovered in front of the Leafs’ goal for a sure-handed tap-in.

The stage was set for Matthews’s heroics, the player firing a shot above Mrazek’s shoulder after winning a draw in the offensive zone.

McElhinney improved his record to 7-4-0 on the year.

“I thought [McElhinney] had a really good game for us,” Leafs coach Mike Babcock said. “He was really steady, we made some mistakes and he was there to make the saves and did a real good job. If you go through, I don’t know how many starts in a row he’s been solid for us so when you can have that solid guy to gain confidence and you know you have a chance to win that’s a real positive for us.”