Updated

Manu Ginobili sparked the Spurs to a big fourth-quarter lead and he drew the foul that negated Carmelo Anthony's winning basket in San Antonio's 113-112 escape from the Denver Nuggets on Thursday night.

The Spurs led 111-108 with 8 seconds left when Anthony got behind the defense for a dunk. Antonio McDyess' inbounds pass was deflected by J.R. Smith off Ginobili's head and into the arms of Anthony, whose basket gave the Nuggets a 112-111 lead with 7.1 seconds left.

Ginobili's running bank shot at 4.2 seconds put the Spurs back on top 113-112.

After a timeout, Anthony got the inbounds pass from Ty Lawson and drove the lane. He ran over Ginobili as he made a buzzer-beater as the crowd went crazy.

But the officials called off the basket for an offensive foul.

After a review, the officials put .4 seconds back on the clock, and the Spurs inbounded the ball for the win.

It was the second game-winner in as many days for Ginobili, who hit a fallaway jumper as time expired Wednesday, lifting San Antonio over Milwaukee 92-90.

San Antonio improved to an NBA-best 22-4 while dropping the Nuggets to just their second loss in 13 home games.

Tim Duncan had 28 points and Tony Parker added 24 for the Spurs but it was Ginobili's spurt that sparked San Antonio.

Averaging 20.2 points, Ginobili had just three points when he sliced in for a backdoor basket, hit a step-back basket — like the one he used to beat Milwaukee — and then hit a deep 3-pointer to give the Spurs a 94-88 lead early in the fourth quarter.

Three minutes later, the lead was 102-93 and the Nuggets were calling another timeout to figure out how to stop the Spurs, who had trailed for the first 32½ minutes but suddenly seemed unstoppable.

The Nuggets found a way to claw back and make the final minute an exciting, if disheartening one.

Anthony led Denver with 31 points and Arron Afflalo scored 20.

Until the final minute, the highlight of the game was Smith's dunk over Gary Neal with .6 seconds left in the first quarter. His subsequent free throw gave the Nuggets a 37-28 lead that marked the most points the Spurs had surrendered in any quarter this season.

Smith took off 11 feet from the basket and slammed it through the hoop with both hands as he ran into Neal, sending him to the court. The rim-rattler drew nods of appreciation from the Nuggets bench and was posted on YouTube within minutes.

McDyess' dunk gave San Antonio its first lead of the game, 77-76, with 3:23 left in the third quarter.

Notes: Denver PG Chauncey Billups (wrist) missed his second straight game. The Nuggets are hopeful he can return Saturday night against Minnesota. ... Spurs C DeJuan Blair returned from hyperextending his right knee Wednesday night against Milwaukee to log 14 minutes. ... Denver's Nene didn't have a foul in the first half but picked up three quick ones in the first 2½ minutes of the third quarter.