CLEVELAND -- The Dallas Mavericks spent most of Monday afternoon playing as if they had a point to prove. They spent the final minutes barely hanging on for a narrow victory.
The Mavericks squandered nearly all of a 24-point lead before finally subduing the Cleveland Cavaliers for a 102-97 win. What appeared to be an easy day turned into a white-knuckler for Dallas coach Rick Carlisle, whose team bounced back from its worst performance of the season in a home loss to Portland on Saturday.
''We did a good job of holding them off at the end,'' Carlisle said. ''We got it done. That's the bottom line.''
Trailing 100-97 with 2.8 seconds remaining, the Cavaliers were called for a five-second violation when Jarrett Jack failed to get the ball inbounds. Ellis put the game away with two free throws with 1.1 seconds left.
Carlisle called Saturday's loss, in which the Mavericks trailed by 38 points early in the fourth quarter, ''beyond embarrassing.'' And while Monday's game had too much drama, Carlisle was happy to get out of town with a win.
''It's the NBA,'' he said ''It's supposed to get hairy.''
''This was a big bounce-back win from an embarrassing loss the other day,'' Ellis said. ''We'll be a great team if we continue to play like that with our back against the wall when we face adversity.''
Kyrie Irving led Cleveland with 26 points. Luol Deng, acquired from Chicago on Jan. 7, scored 20 points in his first home game with the Cavaliers while Anderson Varejao had 18 points with 21 rebounds.
Dallas built a 59-35 lead late in the second quarter and maintained a double-figure lead for most of the second half before the Cavaliers rallied. Cleveland cut the lead into single figures early in the fourth quarter. The Cavaliers got the lead to 91-89 on Deng's 3-pointer, but Irving missed a jumper and a 3-point attempt on the same possession when Cleveland had a chance to tie or take the lead.
A basket and two free throws by Ellis followed by Marion's steal and score pushed the lead to 97-90 with 1:35 to play. Cleveland cut the lead to 98-95, but two free throws by Jose Calderon with 11.1 seconds remaining pushed the lead to five. Varejao's basket with 5.7 left made it 100-97.
Ellis missed two free throws with 2.8 seconds left and gave Cleveland one last chance. The Cavaliers called timeout, but Carlisle put 6-foot-10 center Brandan Wright on Jack, who couldn't get off the pass on a play that was designed to get Irving the ball.
Cavaliers coach Mike Brown thought Irving was open in the far corner on the other side of the floor.
''I don't know if we've ever been that wide open before at the end of games on a situation like that,'' he said. ''Jack just couldn't see him.''
''It was going to be a tough pass,'' Irving said. ''It was a crucial turnover. Whether I was open or not doesn't matter. We have to move on and get ready for our next game.''
The Cavaliers went 3-2 on a road trip to the west coast but struggled in the first game of five straight at home. Cleveland led briefly in the first quarter, but Dallas used a 9-0 run late in the first quarter to break a 21-all tie. Dallas shot 55 percent from the field in the first half.
Marion and Blair both made all five of their shots in the first half. Marion scored 14 points while Blair had 11. Marion made his first shot of the third quarter before finally missing a 3-point attempt from the corner. He scored three points and made only one of six shots against Portland.
Blair missed his first shot attempt in the third quarter and was hit with a technical later in the period after being called for a foul while trying to grab a rebound.
Irving scored 18 points in the second half.
Deng, a two-time All-Star, will face the Bulls for the first time since the trade on Wednesday. Cleveland is 3-3 with Deng in the lineup.
The Mavericks bench outscored Cleveland 33-8. Dion Waiters, who averages 14.8 points, was scoreless in 17 minutes for Cleveland.
Mavericks center Samuel Dalembert left the game early in the third quarter with a strained left shoulder. He was taken to the locker room and didn't return.
Cavaliers F Anthony Bennett, the No. 1 pick in the 2013 draft, didn't play for the fourth straight game. ... Cleveland Indians manager Terry Francona watched the game seated next to Mavericks owner Mark Cuban behind Dallas' bench. ... The Mavericks are 11-4 against Eastern Conference teams this season. Seven of their 11 games before the All-Star break are against the East, including the next three versus Toronto, Brooklyn and Detroit. ... G Devin Harris was scoreless in his second game of the season for Dallas. He made his season debut Saturday after missing the first 41 games because of surgery on his left foot.