OTTAWA -- Former Senators goalie Robin Lehner made 39 saves as the Buffalo Sabres rallied past Ottawa 3-2 on Tuesday night.

Lehner is now 4-0-2 against his former team. He was traded with David Legwand by the Senators in June 2015 to Buffalo for the 21st overall pick in the 2015 draft

Justin Bailey, Ryan O'Reilly and Matt Moulson scored for the Sabres (24-23-10).

Bobby Ryan, pointless in his last five, had a goal and an assist for the Senators (29-19-6). Dion Phaneuf also scored as Craig Anderson made 22 saves.

Ottawa wraps up its four-game homestand 2-2-0.

After a solid start to the third period Buffalo kept pushing and wase rewarded as Bailey tipped Jake McCabe's point shot to take a 3-2 lead at 7:38.

Trailing 2-1, the Sabres wasted no time tying the game 51 seconds into the third as Moulson picked up a puck at the side of the net and put it over Anderson's back in front of 16,832 at Canadian Tire Centre.

Coming into the game Buffalo had given up 62 second period goals, third worst in the league. Tuesday night was was no different as the Sabres were outshot 16-7.

Ottawa made it 63 as Phaneuf jumped on a soft rebound and put the puck past Lehner to give the Senators a 2-1 lead.

The Sabres opened the scoring on their very first shot as O'Reilly used Phaneuf as a screen and beat Anderson low glove side. The Senators tied the game at the 14-minute mark of the period as Ryan tipped Erik Karlsson's shot from the point.

This was the fifth and final meeting between the two teams with Ottawa going 1-4-0.