Ryan Miller stopped 38 shots and Thomas Vanek had a goal and an assist as the Buffalo Sabres beat the Boston Bruins 4-2 on Thursday night.

Tyler Ennis had two assists and Jason Pominville added a late goal to seal the Sabres' fifth win in seven games. Nathan Gerbe and Cody McCormick also scored for Buffalo, which won for the third time in five meetings with Northeast Division rival Boston and improved to 21-20-5 overall.

Dennis Seidenberg and Gregory Campbell scored for the first-place Bruins, who had won five of six.

Tuukka Rask had 29 saves for Boston, which was 0 for 4 on the power play and fell to 18-2-3 when scoring first.

The Bruins led by a goal twice but couldn't hold off the Sabres, who got goals from Vanek and Pominville in the third and another great night from Miller, who started his 23rd straight game.

Miller robbed Mark Recchi and Marc Savard on great scoring opportunities in the second to keep it tied at 2 and allow the Sabres to win it in the final period.

Vanek came in on a 2-on-1 and kept the puck, snapping a shot high to Rusk's stick side for an unassisted goal with 14:47 left.

Vanek added an assist when he set up Pominville, whose goal with 3:20 left all but sealed it for Buffalo.

Recchi was all alone in front and swept a backhand right into Miller's glove midway through the period, then on a 2-on-1 Savard fired a shot that Miller got just enough glove on to tip it wide and keep it tied at 2.

Sabres defenseman Steve Montador saved a goal early in the third when the puck got behind Miller. Montador was able to sweep it out of the crease before it could cross the goal line.

The Sabres tied it with 9:24 left in the second on a power-play goal by Gerbe off a crossing pass from Tyler Myers. The puck movement got Rask off balance and he had no chance to stop Gerbe's one-timer from the circle. It was the third goal of the season for Gerbe, a former Boston College player.

Seidenberg gave Boston a 1-0 lead in the first, but McCormick tied it early in the second when he slapped in his own rebound after hitting the post for his seventh goal of the season.

Notes: Play was stopped for several minutes early in the second period to replace a pane of glass in front of the goal judge. ... Savard's assist on Seidenberg's goal was the 499th of his career. ... Boston is 15-1-1 when leading after the first period.