Report: Dirk Nowitzki expected to finalize a 2-year deal with the Mavericks

DALLAS, TX - APRIL 21: Dirk Nowitzki #41 of the Dallas Mavericks reacts against the Oklahoma City Thunder during game three of the Western Conference Quarterfinals of the 2016 NBA Playoffs at American Airlines Center on April 21, 2016 in Dallas, Texas. NOTE TO USER: User expressly acknowledges and agrees that, by downloading and or using this photograph, User is consenting to the terms and conditions of the Getty Images License Agreement. (Photo by Ronald Martinez/Getty Images)

The Dirk Nowitzki era will continue in Dallas.

The Mavericks and their 13-time All-Star have agreed to the framework of a two-year, $40 million deal, ESPN first reported Tuesday. Nowitzki had opted out of his $8.7 million option for the 2016-17 season in late June, making him a free agent.

Nowitzki, 38, has spent his entire 18-season NBA career with the Mavericks, who drafted him ninth overall in 1998 out of Germany.

The 2006-07 NBA MVP and 2010-11 NBA Finals MVP has averaged 22.0 points, 7.9 rebounds, 2.5 assists and 0.9 blocks per game during his career. This past season, he averaged 18.3 points, 6.5 rebounds, 1.8 assists and 0.7 blocks per game. Nowitzki ranks sixth on the NBA's all-time scoring list with 29,491 points.

Nowitzki has averaged 25.3 points, 10.0 rebounds, 2.5 blocks and 0.9 blocks in 145 playoff games. He led the Mavs to the NBA title in 2011.