Sam Amick

USA TODAY Sports

The Miami Heat continued to recover nicely from the departure of LeBron James, agreeing Sunday to sign free agent small forward Luol Deng to a two-year, $20 million deal.

A person with knowledge of the deal confirmed it to USA TODAY Sports, but spoke on the condition of anonymity because it had not yet been announced.

The second year of Deng's deal is a player option.

After James' stunning decision to return to the Cleveland Cavaliers where he began his career, Heat president Pat Riley convinced fellow free agent Chris Bosh to return to Miami on a five-year, $118 million deal.

His next order of business was to find a replacement for James, and he did as well as he could have possibly done given the circumstances in landing Deng.

Deng, a two-time All-Star, was also being courted by the Atlanta Hawks and, to a lesser degree, the Dallas Mavericks. But a financial gap existed in negotiations with the Hawks that made that situation less desirable, and the Dallas situation was untenable because of a number of factors.

Not only are the Mavericks still waiting on word from the Houston Rockets on whether they will match the three-year, $46 million offer sheet given to restricted free agent small forward Chandler Parsons, but the Mavericks' apparent preference to pursue free agent guard Lance Stephenson if they lost out on Parsons was a factor.

The Hawks re-engaged in talks with Deng's representatives Sunday, but to no avail. The Los Angeles Lakers and Detroit Pistons made late inquiries as well.

The Heat's next order of business will be to finalize an agreement with free agent guard Dwyane Wade, who appears likely to return but whose eventual salary was difficult to negotiate because of the uncertainty surrounding Deng's situation.

The Heat pressed Deng's representatives for an answer on Saturday, but he continued to explore other opportunities before finally being convinced by Riley that this was the right fit.

Deng played most of his 10 season with the Chicago Bulls, but was traded to the Cleveland Cavaliers in January.

The Cavaliers' re-signing of James complicated Deng's situation, as sign-and-trade options that could have led to a bigger payday for him were no longer available and James' decision to sign a two-year deal set a new precedent on the market that came into play here. RealGM.com first reported the Deng agreement.