DALLAS -- Dirk Nowitzki, the NBA legend who refused to go on a retirement tour, had no choice but to have his career celebrated Tuesday night in what he confirmed afterward was the final home game of his career.

It started the second that Nowitzki, the sixth-leading scorer in NBA history, stepped out of his car after pulling into the American Airlines Center parking garage for the Dallas Mavericks' home finale. Team employees formed two lines that Nowitzki walked through, and he gave high-fives to each side on his way to the locker room as the support staffers expressed their love and gratitude to the man who has represented the franchise with such grace and dignity during his unprecedented 21 seasons.

It continued throughout the game, with his teammates force-feeding Nowitzki, who launched eight shots on the Mavs' first seven possessions. Nowitzki finished with a season-high 30 points on 11-of-31 shooting in the 120-109 win over the Phoenix Suns, which was essentially the opening act for an elaborately planned postgame celebration.

Nowitzki, 40, was surprised and overwhelmed when five of his childhood hoops heroes -- Charles Barkley, Scottie Pippen, Larry Bird, Shawn Kemp and fellow German Detlef Schrempf -- walked out to midcourt and each delivered brief tribute messages. Mavericks coach Rick Carlisle and owner Mark Cuban also gave speeches honoring Nowitzki before No. 41 finally got the microphone and casually mentioned that he was hanging up his Nikes.

"Mark, can't wait to see what you've got for my jersey retirement," Nowitzki said, smiling at 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."

Nowitzki's retirement was widely anticipated, which is why fans in arenas around the NBA treated him to an unofficial farewell tour throughout the season, but it was a decision he said he reached firmly only in the past few days. Ultimately, he didn't feel he had much of a choice because of chronic pain in his left foot, an unintended consequence from surgery last spring to clean out bone spurs in that ankle.

"There comes a point where you know that a guy has given every last ounce that he can give to this game," said Carlisle, who along with the rest of the Mavs' coaching staff wore under their suit coats the "41.21.1" T-shirts made that recognized No. 41's record-setting loyalty to one team.

A setback suffered while playing pickup games just before training camp in September, when the tendon in that foot became inflamed, forced Nowitzki to miss the first 26 games of the season and caused him to struggle mightily for most of the season, enduring painful, exhaustive treatment just to get on the court.

"I think it's been a long time coming," Nowitzki said during his postgame news conference, which was delayed a bit while he enjoyed a beer with the legends who came to celebrate his career. "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 backpedaling, 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."

Nowitzki will play one last game, suiting up for the Mavs on the road Wednesday night against the San Antonio Spurs, hoping that he has a little bit left in the tank after by far his most prolific game of the season.

The Mavs made a pact to get Nowitzki the ball as early and often as possible. He became the oldest player in NBA history to score 30 points, a distinction previously held by Michael Jordan, whom Nowitzki said was the one childhood hero of his missing from the ceremony. He admitted that he was gassed after his early scoring flurry -- which featured a midrange jumper on the Mavs' opening possession, quickly followed by a 3-pointer, a turnaround jumper and another 3, all assisted by Doncic and longtime teammate Devin Harris -- but managed to play 33 minutes, by far his most of the season.

Nowitzki even managed to mix in a dunk -- his second of the season, both coming in the past few games -- throwing it down with two hands after catching a bounce pass from Dwight Powell. As he hung on the rim for a few seconds, Doncic, 20, hopped up and down with both hands over his head, celebrating like the fans in the sellout crowd who packed the arena from well before tipoff until the confetti printed with "41.21.1" fell at the end of the postgame ceremony.

The night was filled with planned and organic celebrations of Nowitzki, a 14-time All-Star, one-time MVP and one-time Finals MVP who led the Mavs to the franchise's lone championship in 2011. There were a variety of Dirk-themed chants throughout the game, and he received dozens of standing ovations, from his introduction in the starting lineup to each time he went to the scorer's table to check back in to the final time he walked off the home court wearing a Mavs uniform.

During one of those standing ovations, Nowitzki couldn't control his emotions. A video after the first quarter focused on his extensive charity work, in particular the annual visits to a local children's hospital that "Uncle Dirk" did every holiday season throughout his career, refusing to allow them to be publicized until a couple of years ago. Standing near midcourt before play began again, Nowitzki puts his hands on his knees and wiped away tears.

"I actually shot a ball after that, and I don't think I even saw the rim, I had so many tears in my eyes," Nowitzki said with a smile.

The Mavs led by 30 at halftime, but the Suns managed to make the game competitive due primarily to a record-setting performance by their own old-timer. Jamal Crawford, 39, scored 39 of his 51 in the second half, becoming the oldest player in NBA history to hit the 50-point milestone and earning a shoutout from Nowitzki.

"Thanks to the Phoenix Suns for staying out here and letting me have a few baskets. I appreciate it," Nowitzki said during the postgame ceremony as the Suns watched in front of their bench. "Even though Jamal stole my show a little bit today. I'm a little mad at that."

Nowitzki, the good-natured German whom Barkley called "the nicest man ever," laughed at his playful jab at Crawford. Just as Nowitzki chuckled when the Suns double-teamed him on the final possession of the game to prevent him from hoisting one last jumper in the arena occasionally referred to as "The House That Dirk Built."

"There's no words that I can possibly say, Dirty, to describe how I feel and what you've meant to the organization," Cuban said during the postgame ceremony. "But I can make you all kinds of promises. I'll promise you that everything you taught us will continue on. I'll promise you that you have a job for life, I don't care what you're doing. I'll promise you that we'll retire your number -- not a tough decision. And I'll promise you we will put the most biggest, bad-ass statue ever."

Cuban paused, allowing the crowd to unleash an extended roar, before finishing his speech. "And we'll put it right in front of the arena. Thank you, thank you, thank you."

Nowitzki finished his speech by thanking Mavs fans for supporting him "on a hell of a ride with a lot of ups and downs." He vowed to remain a part of the Dallas community and the franchise, but Nowitzki isn't sure exactly what's next for him.

"I want to clear my head," Nowitzki said in his postgame news conference, when he held the microphone in his right hand and leaned back, as he has done so many times throughout his career. "I want to travel. I want to enjoy my family that's sacrificed so much over the last years and see my kids and then go from there. I'm sure after a year or two of doing that, something has to come and find my passion. I'm sure I'll stick around the Mavericks somehow."

Carlisle said Nowitzki's retirement plans hadn't quite hit him yet.

"When it does, I'll be in tears," Carlisle said.

Nowitzki is also still trying to wrap his head around the fact that his next game -- the 1,522nd regular-season appearance of his career -- will be his last.

"I know that I'll miss the heck out of it, out of everything," Nowitzki said. "But it's time."