Hassan Whiteside is staying with the Miami Heat.

A person familiar with the terms of the agreement tells The Associated Press that Whiteside will be signing a four-year contract worth the maximum amount the Heat could offer, roughly $98 million. The person spoke to the AP on condition of anonymity because the deal cannot be finalized and signed before July 7.

Whiteside made his announcement Friday on Snapchat and through a post on The Players' Tribune, a few hours after he met with the Heat and the Dallas Mavericks in New York to hear their sales pitches. He went into those meetings leaning toward the Heat, and apparently emerged even more convinced that staying with the franchise that helped him resuscitate his career was the best move.

More from FoxSports

''I've played on eight teams since college - from Reno to Sioux Falls to Sichuan, China,'' Whiteside wrote on Players' Tribune. ''I am not ready for there to be a ninth. I have decided to re-sign with Miami. I just wanted to take this time to tell all the fans how much you mean to this team, and to me. Can't wait to get back to work and try to bring another championship to Miami.''

It is life-changing money after a breakout season. Whiteside will be signing a contract worth roughly 100 times more than what he made this past season, when he averaged 14.2 points, 11.8 rebounds and a league-best 3.7 blocked shots per game. His career path is well-known, taking him to less-than-glamorous leagues in Lebanon and China, stints in the NBA Development League and even getting cut from teams at that level.

''Big big congrats to (at)youngwhiteside,'' Heat free agent guard Dwyane Wade tweeted Friday morning. ''Your dedication and hard work to the game has finally paid off.''

Wade ended his tweet with the hashtag, ''Caniborrow5dollars,'' a nod to the financial stratosphere Whiteside will soon enter.

The Heat signed him in November 2014, and less than two years later Whiteside has become one of the game's most dominant centers - and one of the highest-paid players in Miami franchise history.

Part of that is simply because of the enormous jump in the salary cap this summer, but part of that is because of the potential the Heat see in Whiteside. What he did this past season left such an impression on Heat President Pat Riley that the nine-time NBA champion went into this summer stating publicly that keeping Whiteside was Miami's No. 1 priority.

If that truly was the case, especially given the uncertainty over Chris Bosh's status going forward because of how his last two seasons ended early due to blood clots, then keeping Wade had to be priority No. 1A. It took a $20 million deal for the Heat to keep Wade this past season, and negotiations on a new deal haven't gone particularly well so far.

But Whiteside is staying and made his announcement with flair.

On his Snapchat video, someone asks Whiteside, ''Hey cuz, where you gonna sign?''

Whiteside replies, ''Miami,'' - as Will Smith's hit ''Welcome to Miami'' plays and the words ''Heatnation it is'' appear on the screen.

''Congrats to the big fella,'' Bosh wrote Friday on Twitter. ''Great to have you back bro!''

For the Mavericks, it's the second consecutive year where they fell short on the chase for a marquee center.

Dallas had a commitment from DeAndre Jordan last summer, in what seemed like a huge move for the Mavs before it turned into a peculiar farce. In the days between that non-binding verbal agreement being reached and the end of the league's summer moratorium on player movement - meaning when a contract could actually be signed - Jordan had a change of heart and decided to return to the Los Angeles Clippers.

And the Heat are far from done in the free agency chases; they remain scheduled to sit down with Kevin Durant on Sunday.