The Dallas Mavericks declined Dirk Nowitzki's $25 million contract option for the 2017-18 season earlier this summer, but there was never any doubt as to whether the 39-year-old future Hall of Famer was going to return to Dallas.

According to ESPN's Tim McMahon, the Mavericks are now finalizing a two-year, $10 million deal with Nowitzki, with a team option for the second year.

Even though Nowitzki is nearing the end of his career, this is an extremely cheap deal for the Mavericks. Dirk averaged a respectable 14.2 points and 6.5 rebounds in 54 games last season while shooting 38 percent from behind the 3-point line. He'll likely see his load decreased from the 26.4 minutes per game he played last season, but he's still capable of being quite productive.

While some stars demand huge contracts despite decreased productivity later in their careers, this is really no surprise for Nowitzki, who has consistently taken less money in the latter stages of his career to help the Mavericks build for the future. His cheap deal provides flexibility for a team that is now focused on young players like Harrison Barnes, Nerlens Noel (if they can retain him) and rookie guard Dennis Smith Jr.

Earlier this year, Nowitzki suggested that the upcoming season, his 20th in the NBA, will be his last.

"Twenty is a great number. I think 20 seasons also with one team, like I'm trying to do it -- I think only Kobe has done it -- that's another great accomplishment," Nowitzki said in March. "So I kinda want to make the 20 fold. Plus that summer I'm turning 40. I think that's also a good number to be in the league ... from 20 to 40. That's what I'm looking at."‎

The German-born Nowitzki is almost unquestionably the most accomplished international player in NBA history. He's currently sixth all-time in total points, ahead of Julius Erving and just behind Wilt Chamberlain. He's also in the top 10 in league history in several categories, including games played, minutes and field goals. He's a 13-time All-Star who won the 2006-07 NBA MVP and the 2011 Finals MVP by leading the Mavericks to the franchise's only championship.

Dirk is a sports legend in Dallas, and the Mavericks are surely grateful to him for taking less money to help the team progress.