Update, July 12: To no one's surprise, the Mavericks on Friday announced that Kristaps Porzingis formally signed the contract to which he agreed on June 30, in the early minutes of NBA free agency.

The Mavericks on Friday made the signing official, but did not disclose terms of the deal. As has been reported all along, Porzingis and the Mavericks had agreed to a five-year, $158 million max contract that is set to be the largest in franchise history.

An unforeseen revelation, however, came after the contract was filed to the NBA and one of its key details was reported by The Athletic's Shams Charania.

The contract's fifth year is a player option, Charania reported, citing an unnamed source. What it means is that Porzingis can opt out of the contract's fifth season, in which he is scheduled to be paid $36 million.

Sources: Dallas Mavericks star Kristaps Porzingis‘ five-year, $158M maximum contract gives him a player option in the final season in 2023.

It also means that if Porzingis, who turns 24 next month, opts out of the fifth year, the length of his contract will mirror, in years, the contract for 20-year-old Mavericks guard Luka Doncic. The difference is that the last year of Donic's deal, 2022-23, is a team option.

Original story, June 30: As expected, shortly after the NBA free agency period began at 5 p.m. Sunday, the Mavericks and restricted free agent Kristaps Porzingis agreed to a historic five-year, $158.253 million maximum-salary contract.

Why is it historic? It's the largest contract in the Mavericks' 39-season history - in total, by season average and in a single season.

Porzingis, 23, was acquired by the Mavericks from the Knicks on January 31 in a blockbuster seven-player trade in which Dallas also sent New York its first-round picks in 2021 and 2023 (top ten-protected).

Assuming 7-foot-3 Porzingis plays in October's season-opener, it will have been 20 months since he played in an NBA game, as a Knick, on Feb. 6, 2018. That was the night he sustained an ACL tear in his left knee, requiring major surgery.

At the time of the injury, Porzingis was averaging 22.7 points and 6.6 rebounds and had been named to the Eastern Conference All-Star team.

His 7-foot-6 wingspan and prodigious talent were why the Mavericks, despite the injury, pounced on the opportunity to acquire him. Dallas also ran the minor risk that Porzingis might sign a one-year, $4.9 million qualifying offer this summer and enter unrestricted free agency next summer, but bypassing a guaranteed $158 million payola never made much sense.

A league source told The News that Porzingis' contract is fully guaranteed, with no provisions regarding Porzingis' playing time.

The earliest Porzingis and other free agents can sign their new deals is July 6, when the signing moratorium ends. Porzingis won't actually sign his deal until the Mavericks complete most of their free agency maneuvering and go over the salary cap, which then will enable them to sign Porzingis without consuming salary cap space.

Until now, the largest single Mavericks contract was the four-year, $94.438 million deal that Harrison Barnes signed on July 7, 2016.

Dirk Nowitzki made about $255 million during his Mavericks career, but that was spread over 21 seasons and multiple contracts.

mobile-only dfpPosition2

The Mavericks' franchise record for a single-season salary was $25 million, earned by Nowitzki in the 2016-17 season, followed by Barnes' $24,793,702 million salary last season, before he was traded to Sacramento.

Porzingis is scheduled to make $27,285,000 this upcoming season, with eight-percent raises ($2,182,800) in each of the ensuing four seasons of his deal: He'll make $29,467,800 in 2020-21; $31,650,600 in 2021-22; $33,833,400 in 2022-23; and $36,016,200 in 2023-24.

Under terms of the collective bargaining agreement, the maximum starting salary Porzingis could earn was 25% of the NBA salary cap. When the NBA on Saturday night raised the 2019-20 cap from a projected $109 million to $109,140,000 it gave Porzingis a slight first-season salary bump and a $203,000 boost over the five year life of his contract.

Largest single-season salaries in Mavs history

Brad Townsend, Mavericks beat reporter. Brad covers the Dallas Mavericks and the NBA. He has been a Dallas Morning News sports reporter since 1993. Prior to that he worked at The Houston Chronicle and San Antonio Light.