Updated

After a 16th straight win was safely in the books for the Miami Heat, Shane Battier pulled on a pair of jeans, chatted for a few minutes and walked into the night.

Forgive him for not being impressed.

Battier was part of a team that won 32 straight in his college days at Duke, and he appeared in each of the 22 consecutive wins that the Houston Rockets posted in 2008. And while those were magical rides, neither team finished those seasons with a title.

"We have bigger goals ... something greater than this," Battier said.

That's why there wasn't much of a locker-room celebration for the Heat on Wednesday night, not even after LeBron James drove the lane for a layup with 3.2 seconds left to help Miami pull off a late scramble and beat the Orlando Magic 97-96, extending their franchise-record winning streak.

Miami led by 20 points early in the third quarter, then blew all of that lead and more, having to rally from a five-point hole in the final minutes.

"This is tough," Magic coach Jacque Vaughn said after his team fell to 0-2 against Miami this season — the two losses by a total of three points. "You've got guys who battled, who really wanted to win this game and deserved to win this game."

Ultimately, Orlando was doomed by two plays — James getting the last basket, and Battier taking another away from the Magic.

James missed a pair of 3-pointers about 90 seconds earlier, so he went for the 3-footer instead. From the right wing, James drove diagonally through the lane then used his left hand — after all, he is left-handed — for the basket that won it for Miami. It was the first time he came up with what became a winning basket in the final 5 seconds of a game since a 3-pointer beat the Magic in the 2009 playoffs, according to STATS LLC.

"I had no intention of shooting another jumper," James said.

Dwyane Wade scored 24 points on 10-for-16 shooting — he's shooting 62 percent in his last seven games — and Chris Bosh added 17 points and 10 rebounds for the Heat, who blew a 20-point, second-half lead and then rallied from a five-point deficit in the final minutes.

Nik Vucevic had 25 points and 21 rebounds for the Magic, who got 16 points apiece from Jameer Nelson and Tobias Harris, 13 from Arron Afflalo and 12 from Maurice Harkless.

"They're one of the best teams in the NBA, if not the best and we gave it our all," Harris said. "They knew that. It's just a matter of a couple of seconds that could have changed the game. It's a tough loss for us, but it's the right step in the right direction."

Vucevic now has two games of 20 rebounds or more in his career — both this season, and both against Miami. He had a 20-point, 29-rebound effort in a loss to the Heat on Dec. 31.

But he was one of three Magic players to foul out in the final minutes, as Orlando let a golden chance go awry.

Nelson hit a jumper with 1:36 left, giving the Magic a 96-93 lead. James missed two 3-pointers on the next Miami possession, and on the ensuing Orlando trip, Harris drove from the left baseline but his basket was waved off, with Battier beating him to the spot and drawing an offensive foul, Harris' sixth of the night.

Battier said he had no hesitation about the charge.

"He is defined by winning plays," Heat coach Erik Spoelstra said. "He just continues to make them."

Miami tried for the tie twice on the next trip, but Wade and Ray Allen missed 3-pointers. Bosh was fouled on a rebound — the sixth on Vucevic, making him the third Orlando player to reach the limit in the final minutes. Bosh made both free throws to get the Heat within one with 38 seconds remaining.

Al Harrington missed a wild 3-pointer, and James got the rebound to seal the stop Miami desperately needed. So with 12.6 seconds left, the Heat got the ball and a chance to win.

Spoelstra had told referees that if Miami got a stop, the Heat did not want a timeout. One was whistled anyway, and Spoelstra said that referees apologized for the miscommunication afterward. No matter — the play got set up, the ball went to James, and he delivered in the clutch.

Orlando had no timeouts, and only managed a 3-point try by Afflalo from near midcourt as time expired.

"It's about getting W's and trying to find a way not get L's," Wade said. "Tonight we found the way."

The foul discrepancy in the game — 30 for the Magic, 17 by Miami — was a hot topic in the Orlando locker room afterward. The Magic went 10 for 12 from the foul line, Miami 27 of 31.

Even with all that, James needed to deliver.

"He took it into his own hands," Spoelstra said.

NOTES: James was in double figures for his 200th straight regular-season game with the Heat, extending his franchise record. ... Vaughn played against Miami 30 times in his career, his teams going 15-15. ... The Heat have honored a military member who has returned home from a tour of duty in Iraq or Afghanistan before games in Miami for the past several seasons. Their honoree on Wednesday: Army 1st Sgt. Darrell Williams, who returned just two weeks ago from serving a tour in Afghanistan — and is the first cousin of Bosh's wife, Adrienne Bosh.