The Canadiens will receive Buffalo's third-round pick (No. 68 overall) in next week's draft as part of the deal, which was announced Saturday.
Beaulieu spent his first five seasons with Montreal. The 24-year-old set career highs with four goals, 24 assists and 28 points last season.
Montreal was in danger of losing Beaulieu in the expansion draft, while Buffalo has room to protect him.
Canadiens owner Geoff Molson tweeted, "Thank you Nate for everything" after the trade.
Beaulieu immediately improves the Sabres' blue line under new coach Phil Housley, a Hall of Fame defenseman.
The Associated Press contributed to this report.