LeBron James scored the game-winning layup with 3.2 seconds remaining Wednesday to give defending NBA champion Miami a 97-96 victory over visiting Orlando, stretching the Heat's win streak to 16 games.
James dribbled to the basket while being guarded, but flipped the ball up and into the basket to boost Miami's overall club-record victory run and provide his team with a 12th consecutive home triumph.
The reigning NBA most valuable player finished with a game-high of 26 points, while Dwyane Wade added 24 points and Chris Bosh contributed 17 points and 10 rebounds for the Heat.
Miami, with the best record in the Eastern Conference at 45-15, moved within one triumph of matching the longest win streak in the NBA this season, a 17-game run by the Los Angeles Clippers.
The Heat will have a chance to pass the Clippers with triumphs at home on Friday against Philadelphia and Sunday against Indiana.
Orlando, with the NBA's second-worst record at 17-45, were led by 25 points and 21 rebounds from 7-footer Nikola Vucevic, a 22-year-old from Montenegro.
Miami led 55-40 at half-time before the Magic rallied within 77-74 entering the fourth quarter. Orlando opened the fourth quarter with a 12-4 run for an 86-81 lead before the Heat bounced back to leave the game level at 93-93 with 2:22 remaining.
Jameer Nelson's jump shot and a Tobias Harris free throw gave the Magic a 96-93 lead. James, Wade and Ray Allen missed three-pointers before Bosh hit two free throws after being fouled by Vucevic to pull Miami within 96-95.
Orlando's Al Harrington missed a three-point attempt and James grabbed the rebound, setting up the final Heat possession and his game-winning shot.
Miami last lost on February 1 at Indiana and the Heat last dropped a home game on January 4 against Chicago.