Free-agent guard Dion Waiters has agreed to terms on a four-year, $52 million deal to return to the Miami Heat, league sources told ESPN's Adrian Wojnarowski.

Waiters, 25, turned down a player option worth a little more than $3.2 million to test free agency.

Last season, his first in Miami, Waiters averaged 15.8 points per game, the second-best mark of his career. He also posted career highs in assists (4.3) and rebounds (3.3) per game, as well as for 3-point percentage (.395).

Waiters made tremendous progress as a professional in Heat coach Erik Spoelstra's system upon his arrival in Miami in 2016, and Waiters ultimately had his agent, Brandon Rosenthal, navigate a significant contract in what has become a rapidly deteriorating market. (Rosenthal also negotiated Andre Iguodala's three-year, $48 million deal with the Golden State Warriors.)

Waiters was selected fourth overall by the Cleveland Cavaliers in the 2012 draft. He was traded to the Oklahoma City Thunder in a three-team deal in January 2015.

Oklahoma City gave him a $6.8 million qualifying offer in the summer of 2016, but the Thunder rescinded it later that July after losing Kevin Durant to the Golden State Warriors, giving Waiters the opportunity to sign elsewhere. Waiters eventually agreed to a $2.9 million deal with the Heat, with a player option for 2017-18.

Information from ESPN's Ian Begley was used in this report.