CLEVELAND -- The Cavaliers looked dead in the water midway through the fourth quarter.
The visiting Utah Jazz seemed to have the game in the bag but totally unraveled down the stretch.
The Cavs recorded an improbable 104-101 victory on Wednesday before an announced crowd of 12,124 at Quicken Loans Arena.
The Cavs (21-40) outscored the Jazz 12-1 in the last 2:35.
"Merry Christmas to us," Cavs coach Byron Scott said. "We got lucky. That was a gift. We can't come out and play like that and expect to win."
The Jazz had a 76-68 lead entering the fourth quarter. They were up by 12 with 7:26 to play.
"We have to make smarter decisions in close ballgames," Jazz coach Tyrone Corbin said. "We need to make sure we understand the sense of urgency when we execute."
Scott dusted off former Jazz swingman C.J. Miles for the fourth quarter. He immediately starting bombing in shots, scoring all 12 of his points.
The Cavs' defense also picked up, which fueled their fast-break game. Point guard Kyrie Irving, quiet for much of the night, also caught fire.
His three-point play with 1:07 left pulled the Cavs to within one point, 101-100.
Irving, who shot just 7-of-20 from the field, recorded his third double-double of the season with 20 points, 10 assists, seven rebounds and two steals. He had 11 points in the last 4:25.
"Shots started to fall," Irving said. "We got a couple steals that turned into transition baskets."
Jazz point guard Mo Williams was impressed with the All-Star.
"Kyrie is Kyrie," Williams said. "He's a hell of a basketball player. He's one of the better point guards in the league. He's up there with the elite.
"I'm a fan of Kyrie's. It's fun to see his growth in this league. He is going to be special. His potential is astronomical."
The Cavs trailed the entire second half until shooting guard Wayne Ellington's slam dunk with 56 seconds left handed the Cavs a 102-101 advantage.
Williams, who had missed the previous 32 games after thumb surgery, drove to the basket and had his shot roll in and out with 4.9 seconds remaining.
"It was heartbreaking," Corbin said.
Williams was even more disappointed.
"I've never seen a layup come out like that," he said. "I haven't seen the replay, but that was amazing. I've shot a trillion layups in my life, but I've never missed one like that how it went in and came out."
Ellington followed with two free throws with 2.8 seconds left for the final three-point margin.
Cavs power forward Tristan Thompson added 16 points and 12 rebounds, while Ellington had 16 points and six rebounds. Forward Alonzo Gee contributed 15 points and five rebounds.
"Coach challenged us tonight," Irving said. "He said the offense will take care of itself. We got the stops we needed. We got pressure on the ball."
They held Utah to 43.7 percent shooting from the floor. They also blocked a season-high 12 shots, including three rejections by Tyler Zeller and Thompson.
Scott was concerned before the game about the Jazz's bruising frontcourt. He didn't have to be. The Cavs outrebounded Utah 49-38.
They outscored the Jazz 36-25 in the fourth quarter as they seemed to come up with every 50-50 ball.
Williams missed a 21-footer at the buzzer for the Jazz (32-29), who have a 1 1/2-game lead over the Los Angeles Lakers for the eighth spot in the Western Conference playoff race.
Jazz swingman Gordon Hayward led all scorers with 25 points and added seven assists.
"He's a good player," Scott said. "He's fearless."
Utah was playing without its best player, center Al Jefferson. Center Enes Kanter added 17 points and seven rebounds, while forward Paul Millsap had 16 points and eight rebounds.
It was the Cavs' 21st victory, which matched last season's win total. That wasn't a surprise to Scott.
"We expected to have more wins than we did last year," he said.
NOTES: Williams started at point guard for the Jazz after missing the previous 32 games after having surgery on his right thumb Jan. 2. He was injured on Dec. 22 at Miami. Williams played for the Cavs from 2008 to 2011 before being dealt to the Los Angeles Clippers in the Baron Davis trade in February 2011. The first-round pick the Cavs received from the Clippers turned into Irving. ... The Jazz also benched small forward Marvin Williams in favor of DeMarr Carroll. ... Scott has devised a plan to keep the bug that has ravaged his team from being even more contagious. "We'll wear gloves and surgical masks," he joked. Cavs center Tyler Zeller returned to the starting lineup. Zeller and shooting guard Dion Waiters missed Monday's game and spent some time in the hospital over the weekend with flu-like symptoms. They were throwing up and had extreme pain in their stomachs. Guard Daniel Gibson was added to the list Wednesday. Waiters and Gibson were told to stay home and didn't play vs. the Jazz. ... Cavs forward Omri Casspi said he has been cleared to begin some activities on the court. He had an appendectomy on Feb. 23. "I haven't done anything for two weeks," he said.