It is a two-year, $20 million contract with a player option after this coming season, sources told Stein.
Dallas and Atlanta had been in the hunt for Deng, as was Phoenix, who jumped into the mix on Saturday, according to sources.
Deng is entering his 11th NBA season, having spent almost his entire career with the Chicago Bulls. He was traded from Chicago to Cleveland in January after years of trade rumors.
The Heat plan to team Deng with the freshly re-signed Chris Bosh and soon-to-be-reupped Dwyane Wade in the wake of LeBron James' decision to return to his home-state Cleveland Cavaliers. The Heat also re-signed guard Mario Chalmers to a two-year deal on Sunday, sources told ESPN.com's Marc Stein.
Chalmers took to Twitter to announce he was staying in Miami.
Proud to say I'm back wit the heat. Heat nation we still here- Mario Chalmers (@mchalmers15) July 13, 2014
Deng appeared in 40 games with the Cavaliers after the trade last season.
Deng has averaged 16.0 points per game in his career, after being chosen No. 7 overall from Duke in the 2004 draft.
The Associated Press contributed to this report.