MONTREAL - In a battle of teams wallowing in a season of mediocrity, the visiting Montreal Canadiens beat the Buffalo Sabres 4-3 after a shootout.

Max Pacioretty scored on the Habs' first shootout try, coming in fast against Buffalo goaltender Ryan Miller who, backing up, carried the puck over the line on a low shot.

David Desharnais gave the Canadiens the victory by sliding a puck under Miller's blocker as the Buffalo goaltender slid to his right on a deke.

Carey Price stopped both Buffalo tries to give the Canadiens the win.

Buffalo defenseman Robyn Regehr opened the scoring with his first goal in 353 NHL games.

But Tomas Kaberle knotted the score at one by sneaking in from the point on a powerplay, slipping a David Desharnais pass through the slot under sliding Buffalo goaltender Ryan Miller.

Tyler Myers then put the Sabres ahead after clobbering a puck that had slid free into the slot.

But Scott Gomez scored the equalizer on a powerplay one-timer.

Chris Campoli then gave the Canadiens a lead for the first time at 11:28 of the second period. The defenseman beat Miller with a wrist shot while Gomez screened the net. Ryan White earned an assist on the play.

Tyler Ennis tied the game at three by scoring his fifth goal of the season with 8:05 remaining.

Ennis jumped on an errant centering pass that bounced off the side of the net into the crease, right onto Ennis' stick.

Chris Campoli and Tomas Kaberle were on the ice for the Canadiens at the time as Carey Price was helpless to stop the quickly-released shot.

The Canadiens only managed 13 shots on goal through the first two periods, while the Sabres had mustered 18. 

The victory was the Habs only win in four tries this year against Buffalo. The Canadiens next play in Montreal against the Devils Sunday in a game that starts at six p.m.

Price made 27 stops in the victory, while Miller stopped 16. The Canadiens vaulted into eleventh place in the division with the victory, surpassing Tampa and the Islanders by one point.