Dallas Mavericks star Dirk Nowitzki confirmed his retirement from the NBA on Tuesday, calling time on a 21-season career that saw him become the greatest European player ever to grace the league.

The 40-year-old German had left the door open to extending his career for another season, but finally confirmed his retirement after the Mavericks' 120-109 win over the Phoenix Suns on Tuesday.

"As you guys might expect, this is my last home game," an emotional Nowitzki told the crowd at Dallas's American Airlines Center.

"I've put you guys on a hell of a ride with a lot of ups and downs and you guys always stuck with me and supported me, and I appreciate it," Nowitzki added.

Mavericks fans chanted "Thank You Dirk" as the 7-foot (2.1-meter) tall German bade his farewell.

Several icons of the NBA were also in the arena to witness his send-off, including Larry Bird, Charles Barkley, Scottie Pippen and the Mavs' former German power forward Detlef Schrempf.

Nowitzki, who ranks sixth on the NBA's all-time points scoring list with more than 31,000 points, said he had no plans to leave Dallas after his retirement.

"This is my new home," Nowitzki said. "I left Germany over 20 years ago and became a Texan."

Nowitzki's retirement had been largely expected.

Mavericks owner Mark Cuban had signaled that Nowitzki intended to make an announcement in the days leading up to Tuesday's game.

"It won't be easy," Cuban said Monday. "I know for Dirk it won't be easy, either. But Father Time is undefeated, for all of us."

Nowitzki, who was chosen with the ninth pick in the 1998 NBA draft, would go on to lead the Mavericks to 15 playoff appearances.

He also inspired the team to its one and only NBA championship in 2011.

He was selected to the All-Star game 14 times and also earned the NBA's Most Valuable Player award in 2007. He was the NBA Finals MVP in 2011.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.