BUFFALO, N.Y. -- Maple Leafs goalie Frederik Andersen left Toronto's 5-2 loss to the Buffalo Sabres on Saturday night after sustaining an upper-body injury.

Andersen allowed two goals on 16 shots in the opening period and did not return for the second after getting hurt. He appeared to be hurt during a collision with Buffalo forward William Carrier.

Curtis McElhinney replaced Andersen in net for the Maple Leafs, allowing three goals on 22 in the loss.

Toronto avoided a scare five minutes into the third period when McElhinney was upended by Sabres forward Marcus Foligno, who lost his balance and slid into the net.

McElhinney got up immediately. With Andersen not on the bench, it was unclear who would have had to play in net if Toronto required a third goalie.