Updated 10:33 pm, Thursday, July 6, 2017

Nowitzki and the Mavericks have agreed on a two-year, $10 million contract that carries a team option in the second season, a person with knowledge of the deal said Thursday on condition of anonymity because a deal hasn’t been announced.

The agreement is similar to the one the Mavs and Nowitzki reached last year, although for significantly less money. Last year’s contract was for two years and $50 million, and the club declined its second-year option before free agency opened this year.

Nowitzki, 39, is no longer the primary option for the Mavericks, so a $5 million deal is more in line with his role on a roster that has become significantly younger since the start of last season. The $25 million salary from a year ago was as much about Dallas paying Nowitzki for his loyalty, which included taking less money to help acquire free agents through the years.

Regardless of how much longer he plays, Nowitzki’s legacy is secure after leading the Mavericks to their only championship in 2011 as the NBA Finals MVP. The 7-foot German is also the only foreign-born player with 30,000 career points, a milestone he reached last season.

Gay to Spurs: San Antonio signed forward Rudy Gay, reportedly on a two-year, $17 million deal. Gay averaged 18.7 points last season for Sacramento in 30 games before rupturing his left Achilles tendon in January. The guard has averaged 18.4 points in 753 career games. He, LeBron James and Russell Westbrook are the only players with at least 13,000 points, 4,000 rebounds and 1,000 steals since 2006.

Carter is King: Sacramento and 40-year-old eight-time All-Star Vince Carter agreed to a one-year, $8 million deal, the Sacramento Bee reported. Carter spent the past three seasons with Memphis and will reunite with head coach Dave Joerger, who led the Grizzlies in Carter’s first two seasons there. The 6-foot-6 swingman averaged 8 points and 3.1 rebounds last season.

Hardaway back to NYC: Atlanta restricted free-agent Tim Hardaway Jr. has signed a four-year, $71 million offer sheet from the New York Knicks, according to ESPN. The Hawks will have two days to match the offer. Hardaway had a career year last season, averaging 14.5 points per game in 28 minutes, but, just two years ago, the guard and son of Warriors guard Tim Hardaway was traded from the Knicks by then-president Phil Jackson.

Olynyk to Heat: Miami has reached an agreement with center Kelly Olynyk on what ESPN reported will be a four-year deal worth in excess of $50 million. A 7-footer with three-point range, Olynyk spent his first four NBA seasons with the Celtics and played mostly as a reserve. He averaged 9.5 points in 278 regular-season games shot a career-best 51 percent last season.

Ellis cut: Indiana waived former Warriors guard Monta Ellis. Ellis has played the past two seasons in Indiana, averaging 11.3 points and 4.0 assists in 114 games. He lost his starting job last season. The NBA also announced that Ellis would be suspended for the first five games next season for a violation of the league’s drug policy.