The Miami Heat officially waived Chris Bosh on Tuesday, ending a nearly three-year saga that halted his career because of blood-clot issues.

Last month, Bosh, the National Basketball Players Association and the NBA agreed on a one-time deal to permanently remove Bosh from the Heat's salary cap while allowing Bosh the option of someday returning to his career, sources told ESPN. Under the rules, had Bosh been able to successfully return, the Heat could've seen Bosh's salary returned to their books.

The deal was worked out because Bosh was caught in the middle of two collective bargaining agreements, and all sides wanted the parties not to be penalized over changing rules. Bosh will become a free agent but would have to be cleared to play by a team doctor.

Bosh did some work with TNT last season and said he had begun to think about retirement.

The immediate result for the Heat is that the remaining $52 million on his contract over the next two years will be cleared, and the team's salary-cap space will become about $37 million. This is vital as the team looks to sign free agents when the league's moratorium period ends at the end of the week.

About $29 million of the remaining amount will be paid by an insurance policy and the rest by the Heat. Bosh signed a five-year, $118 million contract with the Heat in 2014 and will have earned more than $230 million in his career by the time all of the money owed to him is paid out by 2022.

Bosh and the team were at odds over the previous 18 months about how to come to a resolution. Bosh gained clearance from a doctor he trusted and intended to play during the 2016-17 season. But he failed a physical during training camp last fall, and the team announced that he would no longer play, a situation Bosh disputed and discussed in a multipart documentary he released.

Heat president Pat Riley said Chris Bosh's No. 1 jersey will one day hang in the rafters of the team's arena. Issac Baldizon/NBAE/Getty Images

But the sides did come together to assemble the agreement during the spring and get closure. As part of the long-coming move to release him, team president Pat Riley announced that Bosh's No. 1 jersey would by retired by the Heat franchise.

"We can't wait to someday hang his jersey in the rafters," Riley said in a statement. "He is, without a doubt, one of the greatest players in the history of the franchise."

Bosh has played in 13 NBA seasons, with seven coming in Toronto before he moved to Miami. He was part of the Heat's championship teams in 2012 and 2013. In 2012, he recovered from an abdominal strain midway through the playoffs to score 19 points off the bench to help the Heat win Game 7 of the Eastern Conference finals. In the 2013 Finals, he got a crucial offensive rebound to set up Ray Allen for one of the biggest shots in Finals history, and he clinched a game by blocking a shot at the buzzer.

LeBron James, who was Bosh's teammate for four years in Miami, took to Twitter to acknowledge the end of Bosh's run with the Heat.

Dwyane Wade spent six years in Miami with Bosh and also tipped his cap to his former teammate on Twitter.

Bosh is an 11-time All-Star and won a gold medal as part of the 2008 Olympic team in Beijing. He averaged 19.2 points and 8.5 rebounds in his career.

"Chris changed his life and basketball career when he came to Miami," Riley said. "And he changed our lives for the better, in a way we never would have imagined, when he joined the Miami Heat. We will forever be indebted to CB for how he changed this team and led us to four trips to the NBA Finals and two NBA championships."