Subban, 23, will earn a prorated $2 million this season, and $3.75 million next season.
Canadiens GM Marc Bergevin met with Subban's agents, Don Meehan and Mark Guy, on Friday, and Subban spent the weekend and parts of Monday analyzing his options with his family before finally agreeing to the deal.
"I'm extremely happy to be at this point now, where the past is behind us, and I can look forward to being integrated into this team," Subban said.
"I'd like to thank Marc Bergevin for his continued cooperation throughout this whole process."
Subban, who spent the last two weeks skating with the OHL's Mississauga Steelheads, earned $875,000 last season as he posted seven goals and 29 assists in 81 games for Montreal, while leading the team in average total ice-time.
The Toronto native had been looking for a five-year agreement, but the Habs remained firm on their two-year offer.
"This was the right decision," Subban said. "This was the best deal, for not only myself, but for the Montreal Canadiens, more importantly."