After a season of speculation, Dallas Mavericks legend Dirk Nowitzki has made it official: he is retiring from the NBA.

The future Hall of Famer made the announcement Tuesday night following the Mavericks' regular-season home finale.

"As you guys might expect, this is my last home game," an emotional Nowitzki told the Dallas crowd, which greeted him with a long ovation.

"I'm trying my yoga breathing but it's not really working that well," Nowitzki joked before continuing.

"This is obviously super, super emotional, there's just too many people to really thank... I 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 so I appreciate it."

Nowitzki played all 21 seasons of his NBA career for the Mavericks, winning league MVP honors in 2006-07 and guiding Dallas to its first NBA title in 2010-11, being named Finals MVP in the process. He ranks sixth in NBA history with over 31,000 career points. His 21 seasons with a single franchise are an NBA record.

The ninth overall pick in the 1998 draft, Nowitzki – a native of Germany – arrived in Dallas as part of a draft-night trade between the Mavericks and Milwaukee Bucks. Twenty-one years later, Nowitzki, now 40, is hanging it up.

Nowitzki's announcement came in a star-studded postgame ceremony that saw NBA legends Charles Barkley, Scottie Pippen, Larry Bird, Shawn Kemp and Detlef Schrempf share their thoughts on the Mavericks star.

Following Nowitzki's speech, Mavericks owner Mark Cuban spoke, thanking Nowitzki and promising not just a jersey retirement – which Nowitzki had joked about earlier – but also a statue of the NBA icon.

The ceremony came after Nowitzki, in what will be his final home game in a storied career, scored a season-high 30 points.

Dallas' season, and now Nowitzki's career, wraps up Wednesday with a road game against the San Antonio Spurs.