Miami won for the 10th time in its last 12 games and moved within one game of Chicago for the best record in the Eastern Conference. The Bulls and Heat both have six losses, and Miami has two games in hand.

Kleiza’s 3-pointer with just under 5 minutes left got Toronto within eight, and another 3 from Bayless as the shot clock expired on the next Raptors’ possession cut the Miami lead to 85-80 — the closest the game had been since early in the third quarter.

Bayless scored again to get the Raptors within three and cap a 12-0 Toronto run. And after Bosh missed a fadeaway from the right baseline, Bayless tried a 3-pointer to tie. It bounced off, and with the game in the balance, James went to work.

He took a hard foul from James Johnson and made two free throws with 2:20 left, not before letting anyone around him know he wasn’t pleased with the physicality of the play. So the next time he touched the ball, he didn’t give the Raptors a chance to foul him — his steal and two-handed slam with 2:07 left restored some breathing room, giving Miami an 89-82 edge and all but sealing the win.

James — who leads the NBA in first-quarter scoring this season (9.1 points a game) — got off to another big start, making his first five shots and scoring 12 points in the opening quarter. He’s now shooting just under 60 percent in first quarters this season.

So while scoring wasn’t an issue, the Heat were far from in the clear.

“This team thrives on turnovers,” Raptors coach Dwane Casey said. “And once they get in the open floor, you can cancel Christmas.”

Casey told the Raptors that establishing pace and limiting turnovers — especially early — would be big keys. Seemed like his team got the message: The Raptors matched a season-high with 27 points in the first quarter, and turned the ball over only five times in the first half. That, combined with DeRozan tying his season best with 16 points in the opening two quarters, kept the Raptors close.

Miami’s lead was only 53-48 at the break, and that was even after James and Wade combined to score 22 points in the opening quarter on 8 for 9 shooting.

In the third quarter, the Heat finally took control — not surprisingly, when the defense picked up a notch.

Toronto missed all but one of its shots over a 7-minute stretch of the third, a span where Miami started with a 55-54 lead and increased it 73-57. Chalmers hit back-to-back 3-pointers late in the 18-3 run, James made a fadeaway with 3:27 to play in the period to close the flurry.

And, just as Casey feared, turnovers proved decisive. Toronto committed eight in the third, which Miami turned into nine points. Miami gave the ball away only twice in the third, and the Raptors didn’t score on either.