Dirk Nowitzki and the Dallas Mavericks have agreed upon a two-year, $40 million deal.

Nowitzki and the Mavericks are still finalizing some of the details.

The second year of Nowitzki's new deal is likely to be a player option.

Nowitzki declined his $8.7 million player option for the 16-17 season. Nowitzki's previous contract was a three-year, $25 million deal.

"Dirk gets to do what Dirk wants," Mavericks owner Mark Cuban said during a public appearance in June. "Period. End of story.

"I told him the other day: If Dirk wants to be the head coach, we'll move Rick [Carlisle] over a little bit. Dirk's done so much for this franchise, he's earned that opportunity."