Dallas Mavericks legend Dirk Nowitzki declared his retirement had been "a long time coming" after playing his final game at American Airlines Center on Tuesday.

The 40-year-old German confirmed his retirement following a 120-109 victory over the Phoenix Suns.

Long-serving great Nowitzki, sixth on the list of all-time NBA points-scorers, marked his last home match by claiming a 30-point haul.

Mavericks coach Rick Carlisle and owner Mark Cuban paid tribute to the 2006-07 MVP before the man himself took the microphone in front of a sell-out crowd.

"Mark, can't wait to see what you've got for my jersey retirement," Nowitzki said to Cuban. "I mean, this is a high bar that you set. But as you guys might expect, this is my last home game.

"I'm trying my yoga breathing, but it's not really working that well. This is obviously super, super emotional."

He added in a press conference: "I think it's been a long time coming. I was struggling this year with my foot. That's no secret. It's just not there where it needs to be to compete at a high level for 82 games.

"I felt actually some of the best today, but I've got a lot of treatment over the course of the season - pills, injections. It just doesn't make any sense anymore to keep doing that for another season, even though I'd love to be there.

"I'd love to be there with Kristaps [Porzingis] and Luka [Doncic] and all these young guys and have fun with them and mentor them as much as I can. But it just doesn't make any sense anymore physically.

"What ended up happening was with more ankle movement, the arthritis was just showing up too much and I was in pain most of the year. You could tell sometimes. When I was backpedalling, my left foot kept sinking in.

"It was a tough year, tough year, but I kept plugging through. And I'm glad it's almost over."

After spending all 21 seasons with Dallas, Cuban says Nowitzki's incredible contribution will be recognised appropriately.

"I promise you that everything you taught us will live on," Cuban said to the stalwart. "I promise you a job for life. I promise you that we'll retire your number. And I promise you will get the biggest, most badass statue ever."