TORONTO -- Matthew Tkachuk scored the only goal of the shootout as the Calgary Flames defeated the Toronto Maple Leafs 2-1 on Thursday.

Derek Ryan scored in regulation for Calgary (26-18-5), which got 35 saves from David Rittich through 65 minutes of action. Rittich stopped Jason Spezza, Auston Matthews and Mitch Marner in the shootout.

William Nylander knotted the game in the third period for Toronto (25-16-7). Frederik Andersen, who had given up 14 goals over his last four starts, stopped 31 shots.

Tkachuk beat Andersen between the pads on Calgary's second attempt.

Andersen made key saves on Elias Lindholm and T.J. Brodie in overtime, while Rittich stopped Kasperi Kapanen twice.

Down 1-0 through two periods, the Leafs tied things on their fourth power play of the night when John Tavares found Nylander, who had gained position at the lip of Rittich's crease on Noah Hanifin, to tip home his 21st at 8:35.

Born in Calgary when his father was a member of the Flames, Nylander nearly gave Toronto its first lead moments later when he deked around Oliver Kylington, but Rittich was there to bail out his defenceman.

After Calgary couldn't connected on a man advantage of their own with under eight minutes to go, Rittich robbed Auston Matthews - the Flames are the only NHL team the centre has failed to register a goal against in his career - on a 2-on-1 to keep things even.

Ryan opened the scoring at 7:34 of the second when he redirected Travis Hamonic's point shot for his ninth.

Toronto came close later in the period when Rittich made a nice save on Nylander's tip of a Travis Dermott drive.

The Calgary netminder, who was named to his first all-star game Tuesday as an injury replacement for Arizona's Darcy Kuemper, was at it again with a pad stop on Kapanen off the rush before stretching to deny Andreas Johnsson on the rebound.

Andersen, who's also going to the all-star game in St. Louis, denied Mikael Backlund with the glove at the other end to keep his team within one through 40 minutes.

The Flames saw their five-game winning streak come to an end Monday in a 2-0 loss to the Canadiens in Montreal. The Leafs , meanwhile, halted an ugly 0-2-1 stretch - one that saw them surrendered a 17 combined goals - with a 7-4 victory over the New Jersey Devils at Scotiabank Arena on Tuesday.

Rittich, an undrafted 27-year-old, downed the Leafs 4-2 in Calgary on Dec. 12 - the last time their potent offence was held under three goals before Thursday.

Toronto played its second game minus star defenceman Morgan Rielly, who joined fellow top-4 blue-liner Jake Muzzin on the shelf this week with a broken foot that's expected to keep him out until at least March 10.

The Leafs and Flames, who each have one more game before a nine-day break that includes the league-mandated bye week and all-star game, had a couple of chances in a scoreless first.

Kapanen forced Rittich into a decent glove save from distance moments as part of an early Toronto. Rittich then stopped a one-timer off the stick of Tyson Barrie, while Sean Monahan had Andersen at his mercy only to fire wide from the slot.

Notes: Toronto hosts Chicago on Saturday, while Calgary is at Ottawa. ... Tkachuk, who's been embroiled in a war of words with Edmonton Oilers forward Zack Kassian since Saturday's testy Battle of Alberta showdown, declined to take things further following Thursday's morning skate. Kassian was suspended two games by the NHL for jumping Tkachuk after the latter rocked him with two crunching body check over the weekend. The NHL saw no issue with either hit, but Kassian called the contact “predatory,” adding that he has “a long memory.” Tkachuk wouldn't bite when asked about the comments in Toronto. “We're not talking about them right now,” Tkachuk said of the Oilers. “We play them sometime after (the all-star) break. You guys can ask us then.” That game is scheduled for Jan. 29 - the first night Kassian's eligible to return to Edmonton.

This report by The Canadian Press was first published Jan. 16, 2020.