Kyrie Irving scored 15 of his 27 points in the fourth quarter for Cleveland, including 12 during a big run, but missed a one-handed floater to give the ball back to Boston with seven seconds remaining and a chance to win the game.
But Celtics guard Rajon Rondo bobbled his dribble against Shawn Marion at the other end and didn't get a shot off before the buzzer, giving Cavaliers coach and Boston native David Blatt a win in his first game in his home town.
Anderson Varejao scored 16 and Kevin Love had 12 points and 15 rebounds for the Cavaliers, who have won three in a row since a 1-3 start.
James scored a season high four days after going for 32 points, 11 rebounds and nine assists against New Orleans. (He was originally credited with a triple-double before the NBA took back one rebound and one assist.)
Kelly Olynyk scored 21 points in a well-balanced attack for the Celtics, who have lost two in a row to open a three-game homestand. Seven players scored at least 12 points, including Jared Sullinger and Jeff Green, who each had 19.
The Cavs cut a 14-point deficit to four with a 14-4 run early in the fourth quarter keyed by a trio of 3-pointers from Irving, who also had a three-point play during the flurry.
Later, a 13-2 burst led by James gave the Cavs a three-point lead with 44.1 seconds remaining.
Irving's one-handed miss in the final seconds was set up by James stripping Rondo near the basket, and the ball going out of bounds off the Boston guard's right leg.
Boston was outscored 38-20 in the fourth quarter despite shooting 50 percent.
Earlier, Sullinger and Olynyk combined to score 21 points and the Celtics shot almost 73 percent in a big third quarter after the score was tied 59-59 at halftime.
They scored 17 of the last 21 points in the quarter to carry a 101-84 lead into the fourth.
James scored 22 points in the first half, including six during an 8-0 run in the second quarter that turned a seven-point deficit into a lead for the Cavs.
James passed Hall-of-Fame center Robert Parish for 24th place on the NBA's all-time points list with 23,360. Parish scored 23,334 points during a 21- year career mostly spent with the Celtics ... Rondo had 16 assists and six points. Avery Bradley, Brandon Bass, Evan Turner and Marcus Thornton each scored 12 for the Celtics ... Cavs sixth man Dion Waiters scored 10 points off the bench after missing the last game with a lower back contusion ... The Cavaliers will start a three-game homestand on Friday against Atlanta ... The Celtics wrap up their three-game homestand on Monday against Phoenix.