It was the sixth win in a row for the Heat (10-3), whose three losses are by a combined six points. The Heat also got a game-high 27 points from Dwyane Wade, who played his first game in a week after resting his sore knees in the two games that he missed.
In the end, the ball went to James.
"We didn't execute that side out of bounds well, but it helps when you have LeBron James," Heat coach Erik Spoelstra said. "The end of it ended up being somewhat what we wanted -- LeBron in space, and he'll take care of the rest. But the execution before that was extremely poor."
Orlando fell to 4-8, including 0-5 on the road. The Magic and the Utah Jazz (0-8) are the only winless road teams in the NBA so far this season. In addition, the Magic set a franchise record with their 17th consecutive road loss dating to last season.
On Orlando's final possession, wing Arron Afflalo missed a spin move in the lane on an air ball. Magic guard Victor Oladipo grabbed the rebound, but his 5-foot jumper from the baseline just missed off the front rim and then the back rim.
"It was a good look for us," Magic Coach Jacque Vaughn said. "We got the ball in the hands of guys who can make plays for us, and that's what you want at the end of the game. Good job by Vic continuing to try to finish the play."
James finished with 22 points, including 19 in the second half and 10 in the fourth quarter. He took a couple of hard fouls in the final four minutes. First, he was elbowed in the jaw by Magic forward Glenn Davis. Then, Magic center Nikola Vucevic fouled James, whose back hit the basket support on his way down.
"We are so accustomed to shooting the ball at a high percentage and making shots," James said. "Those guys (Orlando) got on a run. We got a little frustrated, and we can't do that as a veteran ballclub.
"In the second half, we hit the switch and got a very tough win. It"s very tough playing a team back to back."
Magic guard E'Twaun Moore was hot, scoring a first-half high of 14 points in 17 minutes off the bench. He made all five of his shots, including 4 of 4 from 3-point range. However, he did not score in the second half.
In 26 minutes off the bench, Davis led Orlando with 20 points, making 7 of 13 shots from the field and 6 of 8 from the foul line. In the fourth quarter, he suffered a cut on the right side of his face that required stitches, he but played with energy, his coach said.
"Davis has been working in practice and on his own, getting ready," Vaughn said. "I was pleased with his conditioning."
NOTES: From the oddity department, Heat F LeBron James missed an all-alone finger roll in the first quarter, with the ball bouncing off the front rim. ... James reached double figures in points for the 508th consecutive game, tying him with Kareem Abdul-Jabbar for the fifth-longest streak in NBA history. Michael Jordan (866) has the record, followed by Abdul-Jabbar, Karl Malone and Moses Malone. ... Heat G Dwyane Wade left the game momentarily in the first quarter when he was hit below the belt. ... The Heat is 2-1 in the three games Wade has missed this season. ... Magic G Tobias Harris, who sprained his left ankle in the preseason, is still out but has been practicing the past week. ... Magic G Victor Oladipo entered the game with more turnovers than any other player in the league. In the previous two games alone, he coughed it up a total of 17 times. On Saturday, he had 17 points and just one turnover.