DENVER — Paul Millsap proved worthy of his big contract on Friday night.

Millsap had 27 points, including three straight free throws with 11.9 seconds remaining, and the Denver Nuggets held on for a 95-94 victory over the Miami Heat.

Nikola Jokic added 19 points and 14 rebounds as the Nuggets shook off some late struggles at the line to win their second straight on a six-game homestand.

Millsap, who signed a $90 million, three-year deal with Denver in July, delivered at a key moment. After missing three of his previous four foul shots, the Nuggets’ big offseason acquisition was fouled at the 3-point line by James Johnson and sunk each of his free throws, delighting a lively crowd at the Pepsi Center.

“I’ve learned over the years to never drop your head and never get down on yourself,” Millsap said. “It feels good.”

Dion Waiters nearly won it for Miami on the other end with a 3-point try that rattled in and out in the final second.

“I saw the ball going in,” Jokic said. “Last year we lost a bunch of times like this, so I saw it going in then out and said ‘Yes!'”

Goran Dragic scored 23 points for the Heat. Waiters and Johnson each had 15.

Denver didn’t have a lead until midway through the third quarter when Jokic swished a short jumper to make it 65-63. The Nuggets kept the lead until late in the fourth.

“We weren’t great all night but we showed a lot of resolve in getting this win,” Denver coach Michael Malone said.

In the final minute, Waiters had a driving layup with 30 seconds remaining and Dragic made 1 of 2 from the line to give the Heat a 94-92 lead.

“It’s a tough loss,” Dragic said. “We felt like we had it, that game, but it is what it is.”

TIP-INS

Heat: Dragic and Whiteside both started a perfect 4 for 4 from the field as Miami led 37-28 at the end of the first. The Heat were 15 of 19 from the field in the quarter.

Nuggets: F Juan Hernangomez missed a seventh straight game with mononucleosis. Malone said Hernangomez has taken part in limited work at practice but won’t return for a few weeks. … Emmanuel Mudiay had 12 points and Wilson Chandler had 11. … The Nuggets outscored Miami 25-13 in the third quarter to take a 76-71 lead.

SLIPPERY BASKETBALLS

Waiters briefly lost control of the ball on the final possession before his potential game-winner rimmed out. He blamed the ending on “slippery” basketballs.

“The whole night everybody had no clean feel for the ball. It was so slippery,” Waiters said. “I don’t like their basketballs here.”

FREE THROW SHOOTING

For most of the game, the Nuggets didn’t take advantage of the chances they got at the line. They shot 14 of 25, while the Heat were 7 of 11.

“How many free throws did we miss? 11?” Jokic asked after the game. “I mean that’s something we need to work on. Free throws are the easiest shots in the game.”

UP NEXT

Heat: Visit Blake Griffin and the Los Angeles Clippers on Sunday.

Nuggets: Wrap up a home back-to-back with Golden State on Saturday.