SALT LAKE CITY -- LeBron James had big compliments for the Utah Jazz's crowd before and after Monday's game.
The EnergySolutions Arena faithful had reason to return the praise to Miami's superstar after a wild contest.
Al Jefferson scored 23 points and grabbed 11 rebounds, and Gordon Hayward added 22 points off the bench for the Jazz as they held off a furious fourth-quarter rally to beat the Heat 104-97.
James finished with 32 points, six assists, four rebounds, three steals and two blocked shots, but he made several crucial errors down the stretch that foiled his team's comeback bid.
The Heat (24-12) were unable to complete off a comeback that saw them trim the Jazz's 21-point, third-quarter lead down to two with 3:32 remaining before Utah finished the game with a flurry.
"It was low energy. Low energy against a team like this on their floor with this amazing crowd. Can't play with low energy," James said. "We gave them a little bit of everything. Start of the game, they hit some 3s, got some paint points."
As a result, Miami lost for the third time in four games on a six-city Western swing.
The Jazz, playing for the fourth time in six nights, improved to 21-19.
The Heat were within two -- after Ray Allen scored eight of his 10 points and James had nine to spark a 28-9 spurt -- when James made a couple of uncharacteristic errors that saved the Jazz's day.
First, James was called for goaltending on a short Hayward shot. James then was called for an offensive foul against Jefferson while driving to the basket.
Jefferson hit two free throws, James followed that with a missed 3-pointer, and then Hayward hit one of two foul shots to give the Jazz some breathing room at 98-91 with 2:03 remaining.
"I knew they were going to make their run," Jefferson said. "When we was only up two, I didn't panic."
Miami's Dwyane Wade finished with 11 points, five rebounds and four assists. The star guard didn't play in the fourth quarter, and Chris Bosh played sparingly (40 seconds) in the final quarter. Bosh wound up with 16 points and just one rebound on a night the Jazz outboarded the visitors 40-23.
"That group did a good job bringing us back," Wade said when asked about the fourth quarter. "I don't know. I just always stay ready."
Paul Millsap had 17 points and nine rebounds, and DeMarre Carroll added 12 points for the Jazz. Utah has won two in a row and six of eight to climb two games above .500 for the first time since Dec. 18, when it was 14-12.
Millsap made a key offensive rebound after a missed Jamaal Tinsley 3-pointer with a minute remaining.
On the Jazz's second chance, Hayward hit a fade-away jumper after burning Allen. That gave Utah another seven-point lead with 40.4 seconds remaining.
"G-Time hit a big shot," Jefferson said.
The clincher came when James' pass with just under 30 seconds remaining sailed through Bosh's hands.
"Our guys," Jazz coach Tyrone Corbin said, "showed a lot of character and poise to be able to weather the storm and pull ourselves back together and get a win here against a good ballclub."
Miami jumped on the Jazz early, going ahead 18-12 and looking to repeat the blowout win it had at AmericanAirlines Arena last month.
But the Jazz, who won a last-second, one-point thriller in Utah last March, surged back after a Randy Foye 3-pointer ignited a 10-0 burst.
Carroll scored 11 points and Hayward had 10 during a stretch in which Utah outscored the Heat 38-15 to take a 50-33 lead.
The Jazz shot a sizzling 67.6 percent in the first half against the Heat, who trailed 59-44 at the break despite hitting half of their shots and getting 20 first-half points from James.
"It was a great comeback coming into the quarter. Our guys really played their hearts out, really competed," said Miami coach Erik Spoelstra, whose team shot 54.2 percent but was outscored 19-0 on second-chance points. "Everything has got to go right if you are down 20, but we gave it a shot."
NOTES: Heat forward Shane Battier sat out his third game in a row with a strained right hamstring. ... Jazz forward Marvin Williams started after a three-game absence caused by a knee injury. He scored five points. ... James increased his career total to 19,982 points. The 28-year-old admitted becoming the youngest NBA player to reach the 20,000 milestone would be significant. "It means I've been able to stay healthy, for one," he said. "I've been able to be around teammates that allow me to play at a high level. It is more than a number." ... Jefferson on the Heat's starting center: "Chris Bosh is like a wing trapped in a big man's body. He's always been one I hated to guard throughout my whole career. ... He can shoot it. He can drive by you, left or right. He's a talented offensive player." Bosh laughed at Big Al's description: "No, I don't think so. I just like to take advantage of what I can do well. I like to go inside and out. If have opportunities in the post, I want to play in the post. With LeBron and Dwyane attacking the rims, I know that a lot of my looks come from the perimeter." ... Corbin said his car thermometer showed 2 degrees en route to the team's shootaround. "It's cold for here," he said. With a laugh, he added, "We should have let (the Miami) guys stay out for a while."