James passed Elvin Hayes on a driving layup with 6:58 remaining and has 27,315 career points. The four-time MVP was removed about a minute later and received a loud ovation from the Cleveland crowd.
Kevin Love, a game-time decision because of back spasms, scored a team-high 28 points and had 15 rebounds for the Cavaliers. He missed the morning shoot-around but was in the lineup after warming up on the court about an hour before tip-off.
Kyrie Irving added 23 points for the Cavs, who have won three straight after losing three in a row.
Derrick Williams scored 17 points to lead the short-handed Heat, who have lost four straight.