James finished with 36 points, 13 rebounds and nine assists for Miami (37-14), who won despite blowing a 21-point second-half lead. Chris Bosh had 19 points and Michael Beasley added 16 off the bench.
Stephen Curry led Golden State (31-22) with 29 points and seven assists. David Lee had 21 points and 11 rebounds. Klay Thompson added 17 points.
With the game going the way it was for the first 29 minutes, no one thought it would come down to the exciting finish, with James adding yet another footnote to his illustrious career.
The Heat opened up a 75-54 lead with 7:52 left in the third quarter and were seemingly on their way to easily avenge a nine-point home loss to the Warriors earlier in the season.
Without warning, Golden State suddenly came alive. The Warriors outscored Miami 33-9 over the next eight minutes to take a three-point lead 56 seconds into the fourth quarter. Curry, held to just three shots in the first half, led the charge with 14 points. Harrison Barnes and Thompson combined for 13 points. Andre Iguodala added a spectacular two-handed fastbreak dunk.
Showing why they are the two-time defending champions, the Heat snapped out of their funk and went on a 15-3 run to take a 99-90 lead with 6:44 remaining on the clock.
However, Golden State wasn't finished just yet. Iguodala capped off a 15-5 run with an 18-foot jumper, despite losing the ball momentarily, to give the Warriors a 105-104 lead with 82 seconds left.
The Heat regained the lead with a 3-pointer from James. Curry answered with a jumper to tie the game at 107.
James was fouled on the next possession and made one of two free throws to give Miami a one-point lead. Curry responded yet again. With a couple of devastating crossovers, Curry was able to drive by Mario Chalmers and hit a bank shot from six feet out while being fouled. He converted the free throw and the Warriors led 110-108 with 14.6 seconds left.
The Heat elected not to use a timeout. Guarded by Iguodala, James dribbled the clock all the way down, took a couple of steps left and nailed the game-winning shot from 27-feet out.
“I was going for the win the whole time,” said James. “I had to redeem myself for leaving the game open with missing that free throw. Steph Curry came down and got an and-1. Spo told us to go. I was able to get the ball and I was going for the win. We either go into the All-Star break with a huge road win or with a loss.”
“We witnessed greatness,” said Warriors coach Mark Jackson. “A special player, an all-time great, made a big time shot.”
''If I would have realized he was going to work that thing all the way down to the end of the clock,” said Heat coach Erik Spoelstra. “I would have ran out there and screamed timeout. I tried to design something but once he started to wind it up, I decided I better not break his rhythm and just let a great player make a great play. Make or miss. That's what he did.''
“As far as the move he made and the way he was guarded, there’s nothing you can change about that,” said Iguodala. “There’s nothing I would change. He just made a tough shot. You've got to give him credit for that.”
“It was pick your poison,” said Jackson. “We were willing to live with defense one-on-one once he caught it. The defense was very good and Andre did his job. He just made a great shot.”
Miami shot 53.8 percent from the field and 45.5 percent from the three-point line. James was 14 of 28 and Chris Bosh was 8 of 14. The Heat played without Dwyane Wade (foot).
Golden State shot 48.2 percent, including 59 percent in the second half. The Warriors played without Andrew Bogut (shoulder) and Jermaine O’Neal (wrist).
The thriller was both teams' final game before the All-Star break.
“We feel like we can be better,” said Curry on how the team feels entering the All-Star break. “Obviously, last year we were pretty happy with where we were. This year, we feel like we let some games slip but still have a grip on where we’re trying to go. So we come back and get rejuvenated.”
“If we play at the level we did tonight,” said Jackson. “The way we competed and battled, we are going to look forward to an exciting second half of the season. It will be important to make sure that we come back with this mentality.”
“Hopefully we can change the result of playing here at Oracle like we haven’t in the past couple weeks,” said Curry. “Morale is high. The vision is pretty clear of where we are trying to go when it comes to seeing ourselves where we stack up in the Western Conference and what to expect down the stretch. Confidence is high right now for us as a team."