Updated

LeBron James could hardly stand, certainly couldn't run. Good thing all he needed to do was shoot.

Better get well fast, LeBron. You're one win away from the biggest party of your life.

A limping, grimacing James shook off left leg cramps to hit a tiebreaking 3-pointer with 2:51 remaining and the Miami Heat held off the Oklahoma City Thunder for a 104-98 victory Tuesday night and a 3-1 lead in the NBA Finals that no team has ever blown.

"I was just trying to make a play," James said. "If I was out on the floor, I wanted to try to make a play with the limited mobility I had at that time, and I was happy I was able to come through."

Game 5 is Thursday night and James will have a chance to finish a nine-year chase that started in Cleveland before he famously -- or infamously -- left for South Florida before last season.

"Of course it's there to think about," said James, making it clear he plans to play. "I'll be ready for Game 5."

With James watching the final moments, Mario Chalmers finished off a stellar 25-point effort that matched Dwyane Wade. James had 26 points, 12 assists and nine rebounds, missing a shot at a triple-double only because he was on the bench at the end after thigh cramps emerged following a fall near the Thunder basket.

The Heat needed all James could give and more to hold off Russell Westbrook. He scored 43 points for the Thunder, who wasted an early 17-point lead but were never out of the game because of their sensational point guard. Kevin Durant had 28 points but James Harden threw in another clunker, finishing with eight points on 2-of-10 shooting. Westbrook and Durant were the only Thunder players to score in the last 16:46.

"Shots were falling," said Westbrook, who was 20 of 32. "It really doesn't mean nothing. We didn't come out with the win."

James stumbled to the court on a drive midway through the fourth quarter, staying on the offensive end of the floor as the Heat regained possession on a blocked shot, and he made a short jumper that made it 92-90. After Westbrook missed a jumper, the Heat called timeout as James gingerly went to the court. Unable to walk off, he was carried to the sideline by a pair of teammates.

He returned to a huge roar with a little over 4 minutes left and the Heat down two, and after Chris Bosh tied it, James slowly walked into a pull-up 3-point attempt — perhaps doing so knowing he couldn't drive by anyone — and drilled it.

"That 3 was just sheer will and competitiveness, to contribute in some way," Heat coach Erik Spoelstra said.

That made it 97-94, and when Wade followed with a layup with 2:19 left, the Heat finally enough room to withstand Westbrook, who kept coming all night.

Chalmers, the player who was struggling so badly that the Thunder put Durant on him in hopes of avoiding further foul trouble, made 9 of 15 shots, scoring more points than he had in the previous three games.

"Obviously LeBron James is one of the most dominant players in the game, and he explodes many nights scoring-wise. But we've always got his back, and certain nights like tonight when he wasn't feeling his greatest, you have guys like Mario Chalmers step up, big plays, big moments," said Wade, who had to shake off his own aches and pains after landing hard on his back in the first half following a spectacular block by Serge Ibaka. "That's what this team is built on, and that's the reason we're playing together."

The Heat couldn't have done it without James, who refused to let any pain prevent him from taking the biggest step of his career.

The Heat led 2-1 in the finals last year but James' struggles were their biggest problem as they lost the next three to Dallas. He was at his brilliant best in this one, keeping up his scoring surge but also willingly kicking it out to open teammates whenever he was double-teamed.

He tried to play through the pain, but the Heat had to call another timeout and remove him for good shortly after his go-ahead basket, and Spoelstra said the Heat couldn't keep playing four against five.

Bosh finished with 13 points and nine rebounds for the Heat, who quickly climbed out of the 17-point hole by scoring 16 straight points, with Chalmers and backup Norris Cole helping steady them until James and Wade got going.

"We're going to keep fighting," Durant said. "It's just frustrating, but we're going to keep fighting. That's how we've been since I got here."

In foul trouble the last two games, Durant began the game covering Chalmers, an adjustment that freed him from the burden of defending James. It kept Durant safe from fouls — but the Thunder probably didn't count on the scoring explosion from Chalmers after he totaled just five points over the previous two games.

"I took that as a little sign of disrespect," Chalmers said.

Neither team could gain separation during a dizzying middle two periods, one score quickly answered on the other end as Miami took a 79-75 lead to the final 12 minutes.

Westbrook hit his first four shots and the Thunder made six of their first seven in a 13-3 burst out of the gate. A run of six straight made it 23-12 against the stunned Heat, who started 5 of 17, and it grew to 33-17 on Harden's fast-break layup with 21 seconds left.

The Heat found their spark in Cole, who hit a 3-pointer and then opened the second quarter with another to kick off a 16-0 burst, and the Heat would come all the way back to tie it at 35 on Wade's 3-pointer with 7:57 remaining in the half.

With the crowd back in it, Bosh get them even more fired up by diving on the floor for a loose ball, then leaping up after he was fouled and screaming toward the fans.

Yet the Thunder never gave up the lead, Westbrook constantly coming through with a bucket every time the Heat seemed to get within one point in the final minutes. The Thunder took a 49-46 lead into the break after Shane Battier missed a 3-point attempt just before the buzzer.

Miami finally went in front again in the third, Wade hitting a pair of free throws and James rifling a pass to him after a rebound for a basket that made it 50-49, and the Heat would play from in front for most of the remainder of the period.

Notes: Heat president and former coach Pat Riley was honored before the game with the "Chuck Daly Lifetime Achievement Award" by the National Basketball Coaches Association. Riley is the only coach to win Coach of the Year honors with three different teams. ... Battier came in 11 for 15 from 3-point range in the series, tied with Orlando's Rashard Lewis in 2009 for the most makes ever in the first three games of the finals. He made only one. The most through four games is Derek Harper in 1994, with 14.

___

Follow Brian Mahoney on Twitter: http://www.twitter.com/Briancmahoney