DENVER -- Danilo Gallinari picked the right time to find his 3-point stroke.
Gallinari scored a season-high 28 points, hitting two clutch 3s in the final minutes, and the Denver Nuggets survived a big night from Tim Duncan to beat the San Antonio Spurs 112-106 Tuesday.
Duncan scored 31 points, his season high, to go with 18 rebounds, six assists and five blocks. However, it wasn't enough to keep the Spurs (19-8) from losing for the fourth time in five games.
Kenneth Faried added 19 points and 11 rebounds for Denver (14-12), and Corey Brewer came off the bench to score 16 points. San Antonio got 16 points from Manu Ginobili and 15 from Patty Mills.
The Spurs trailed 98-83 before they made it a game with a 19-7 run late in the fourth quarter. Mills hit two 3-pointers, Duncan scored eight points, and Tony Parker hit a 3-pointer to pull the Spurs within 105-102.
"We didn't give up. We played it horn to horn," Duncan said. "We had stretches there where we played really badly. We got them into transition and turned the ball over. We played right into their hands and dug ourselves a hole."
Gallinari scored 22 points but was just 1-for-8 from long range before he came through in the end. Gallinari sank two 3-pointers in a 90-second span, and Andre Miller hit a 17-footer to make it 110-102 with 2:36 left.
"It feels good because we won the game. If I made all those shots and we lost, we'd probably be talking about something else," Gallinari said. "With the team we have, we can have a different protagonist every game. Tonight it was me, maybe the next night it will be someone else. I was happy to knock down those shots."
The Spurs hit two more buckets and had a chance in the final 30 seconds to get closer, but they missed three 3-pointers in a row before Miller's two free throws sealed it.
"Gallinari just ripped our hearts out with those two 3s," Spurs coach Gregg Popovich said. "On the one, Boris (Diaw) contested him better than anybody could possibly contest him, and he just drilled that sucker. Give them credit. Making shots at the end of the game often wins games, and Gallinari did it."
Denver looked as if it wanted to run away early. The Nuggets led by seven at the break and quickly extended the advantage to double digits in the third. Faried converted a three-point play and Gallinari hit a 3-pointer to spark an 8-2 run that made it 63-50.
The lead grew to 72-55 when Ty Lawson had a steal and a layup.
"We showed a lot of character," Parker said. "A lot of teams could've given up and lost by 25. We battled and had a chance."
The Spurs tried to climb back into it by fouling JaVale McGee four times in the last 2:32 of the third quarter. Down 82-69, San Antonio decided to put the 7-footer on the line, where he made just two of eight foul shots, giving the Spurs an opening. However, San Antonio missed five shots at the end of the quarter, including one that was blocked by McGee, and Denver stretched the lead to 90-75 heading into the fourth.
"We were playing so well at that time, (so) I think it was a momentum thing rather than an advantage thing," Nuggets coach George Karl said. "We stopped running and stopped getting into the open court."
The game was tied at 44 midway through the second quarter when the Nuggets pulled ahead. A long jumper by Gallinari and a steal and dunk by Andre Iguodala gave the Nuggets a four-point lead.
Gallinari hit a running 10-footer and a free throw to extend Denver's lead to 55-48 at intermission.
NOTES: Duncan eclipsed 23,000 career points with two free throws in the third quarter. He is the 31st player to reach that level. ... Ginobili was back in the lineup after missing Monday's loss to Oklahoma City with a bruised left quadriceps. He has missed four games overall. ... Karl is an admirer of Duncan. "He knows how to get shots without the offense getting run through him," Karl said before the game. "If you want to run the offense through him, he'll be glad to take that responsibility, but he's an orchestrator of the game as much as he is a scorer of the game. Other than the great shot-blockers, he's the best defensive big guy I've ever seen play basketball." ... Lawson and Faried were hampered by cold and flu symptoms, but they were in the lineup. However, Denver forward Anthony Randolph was inactive due to a sinus infection. ... Popovich thinks McGee will flourish under Karl. "He's learning to play basketball. It's good for him to be with George because George will demand things from him and teach him," Popovich said. "If the kid has character, he'll get better."