Mike James made two free throws with 0.4 seconds left and visiting Miami snapped a four-game losing streak despite scoring 10 in the fourth quarter.
James hit his free throws after being fouled by Cavs guard Ricky Davis, who got faked into the air and fouled James as the Heat guard was attempting a 3-pointer.
James intentionally missed his third attempt, and the final horn sounded before the Cavs could get off a shot.
Cleveland lost its seventh straight and 13th in 14 games.
Davis scored 19 and rookie Carlos Boozer 15 for the Cavs.