DENVER - Between a sprained right ankle and a suspension, this has been a trying season for Raymond Felton.

But when the Dallas Mavericks needed a basket, Felton delivered. And when they needed a crucial stop, he came through again.

Felton hit a layup with 1.5 seconds remaining in double overtime, then blocked a last-second shot to help Dallas beat the Denver Nuggets 144-143 on Friday night after the Mavericks squandered a 23-point lead.

Dallas coach Rick Carlisle couldn't think of a more fitting person to come through in the clutch.

"The guy has been through an epic year of challenges," Carlisle said. "Our whole team couldn't be happier for him."

Felton has dealt with an ankle sprain that caused him to miss 26 games, and also sat out the first four contests after his guilty plea in a New York gun case.

In the second overtime, with the other starters on the bench, Felton stepped up his game. He drove past Randy Foye and banked in a shot high off the glass. He then got a piece of Kenneth Faried's jumper at the buzzer, causing the ball to wind up short.

"It worked out in my favour," said Felton, who played for Denver in 2010-11.

Danilo Gallinari scored a career-high 47 points, including eight in the first overtime and nine in the second. He was 15 for 23, including seven 3-pointers. He also was 10 of 10 from the free throw line.

"Could've been more fun if we had won," Gallinari said. "The way we came back, it was impressive.

"It was a great game. I hope the fans enjoyed it."

Denver had a chance to win in regulation, but Faried's jumper rolled off the rim. Dallas had a shot to claim victory at the end of the first overtime, only to have Monta Ellis' long shot clang off the iron.

Dirk Nowitzki had 25 points and Richard Jefferson added a season-high 24.

Carlisle pulled most of his starters for the second overtime, relying on a fresher unit. The strategy worked.

"It's most interesting meaningless game I've ever seen," Carlisle said. "But it wasn't really meaningless. There were a lot of good things that happened out there tonight."

The Mavericks rested guard Rajon Rondo with the team locked into the seventh seed. They're still uncertain who they will face in the first round of the Western Conference playoffs.

Ty Lawson had 19 points and a career-high 18 assists for the Nuggets (29-50), who lost 50 games in a season for first time since 2002-03. Interim coach Melvin Hunt fell to 9-11 since stepping in after the firing of Brian Shaw last month.

Denver led by as many as four points in the first overtime, only to have Dallas tie it on a layup by Ellis.

Dallas appeared headed toward a rout early in this game, leading by as many as 23 points in the first half. Denver climbed back with a 37-20 third quarter.

The Nuggets took their first lead on a dunk by Faried with 2:45 remaining in regulation. They increased it to 119-115 on back-to-back 3-pointers by Wilson Chandler and Lawson.

But the Mavericks tied the game at 121 with 29.5 left on Jefferson's layup.

Tyson Chandler wasn't too pleased with Jusuf Nurkic late in the second quarter, glaring at the Nuggets rookie after he pushed Chandler from behind on a dunk. The officials assessed Nurkic a flagrant-1 foul.

Carlisle said he plans on closely monitoring the minutes of his players. Still, he wants them to head into the post-season with an edge, so with Denver charging late, he couldn't afford to rest his regulars.

"We have to do some things better defensively, but we have time to prepare," Carlisle said.

TIP-INS

Mavericks: Chandler Parsons (right knee) missed a third straight game. ... Carlisle earned his 336th win as Mavericks coach. He can tie Don Nelson for most victories (339) in team history should they win out. ... The Mavs' 144 points is the most by any NBA team this season.

Nuggets: Former Nuggets coach George Karl returns Sunday in charge of Sacramento. "I can't wait to be able to sit down and chat with him prior to the game," said Hunt, who was an assistant under Karl. "He'll have some insightful nuggets to throw out there for us. It's always good to see him." ... Denver was without Jameer Nelson (strained right hip flexor) and Darrell Arthur (strained calf). It lost Erick Green in the second quarter when he hurt his left shoulder. ... This was the first double-overtime game at home since Dec. 20, 2007, the team said.

UP NEXT

Mavericks: at Los Angeles Lakers on Sunday.

Nuggets: host Sacramento on Sunday.