OTTAWA, Ont. — Down 2-1 heading into the third period, it looked as though the Buffalo Sabres may suffer a second-straight defeat to a Canadian NHL team. But the Sabres had better plans.

Matt Moulson scored just 51 seconds into the final period, assisted by Sam Reinhart and Jack Eichel to tie the game at 2. Then at 7:38 of the third, Justin Bailey scored his second goal of the year, assisted by Jake McCabe and Rasmus Ristolainen to put the Sabres back on top, 3-2.

Buffalo had practically started the game with the lead when Ryan O’Reilly scored just 24 seconds into the first period. Kyle Okposo and Justin Falk assisted. But Bobby Ryan tied it for Ottawa 14:45 into that period. Erik Karlsson and Fredrik Claesson assisted on the goal.

At 14:33 of the second period, Dion Phaneuf put Ottawa ahead, 2-1. Ryan assisted on the even strength goal.

Sabres netminder Robin Lehner made 39 saves en route to the win.

The Sabres next take on the Colorado Avalanche Thursday night at KeyBank Center.