In his first full stint as head coach last season, the Mavericks reached the NBA Finals for the first time, losing to the Miami Heat in six games.
Johnson, 41, led Dallas to a 60-22 record last season after coaching the final 18 games in 2005 when Don Nelson stepped down.
The new contract makes Johnson the latest member of the Mavericks to be locked into a long-term deal by owner Mark Cuban. During the offseason, Dirk Nowitzki received an extension that also will keep him in Dallas through 2011.
"I think it's a really nice gesture on Mark's part," Johnson said before Thursday night's preseason game against the Sacramento Kings. "We promised each other that we would never have any disagreements as it relates to contracts. It doesn't change anything. We're going to keep working toward our goal of winning a championship."
Johnson had three years left on his previous contract, which averaged $2.5 million per season.
Discussions with Cuban on a more lucrative deal had been ongoing since the Mavericks were eliminated from the Finals. There had been questions about Johnson's long-term future with the Mavericks when he entered training camp without a new contract.
"It's over with," Johnson said. "Anything that's been said in the past is all behind us now. We have a positive organization. I really like our foundation and we don't need any drama, especially as it relates to my contract."
Cuban was in New York on business Thursday, but he said in a statement issued by the club, "I'm thrilled that Avery will be coaching the Mavs for years to come. He's a great partner and person that makes us a better organization. Plus, he's a great coach too. I couldn't be happier for Avery and his family."
Mavericks players were pleased at the news.
"He deserves it," guard Jerry Stackhouse said. "He put his word on the line that he's going to get us to where we want to be and has shown he has the ability to do that."
As a player, Johnson won an NBA championship with the San Antonio Spurs in 1999. He began his coaching career as a Mavericks assistant after retiring as a player Oct. 28, 2004.