DENVER (AP) Boxed into the corner with the shot clock and the game clock winding down, Danilo Gallinari launched a long jumper that found its way to the net and completed the Denver Nuggets' second-half rally.
Gallinari scored 30 points, including the go-ahead basket with 23.8 seconds remaining, and the Nuggets hung on to beat the Detroit Pistons 104-101 on Saturday night.
''When I caught the ball I saw there were about 4 seconds on the (shot) clock, so I thought I had to make a move,'' Gallinari said. ''It was not easy. I was in a tough spot but it went in.''
Gallinari connected despite intense defensive pressure from Marcus Morris.
''Marcus did everything you could do on that shot,'' Detroit coach Stan Van Gundy said. ''It came down to make or miss. We got better shots than they did (at the end) but Gallinari hit a big one. I'm not worried about that. The game was decided in the third quarter because we came out of the locker room and didn't want to make an effort.''
Emmanuel Mudiay had 18 points, including a pair of free throws in the last second, and Nikola Jokic added 17 for the Nuggets, who won their sixth in a row against the Pistons in Denver.
Morris had 20 points to lead the Pistons, who have lost five of their last seven games. Kentavious Caldwell-Pope added 16 points and Aron Baynes had 13 points and 10 rebounds.
Trailing by nine at the break, the Nuggets outscored the Pistons 39-20 to move in front 84-74 heading into the fourth quarter.
''We just got stops and started running,'' Mudiay said of the Nuggets' big third quarter.
Detroit, though, responded with a 14-2 run to start the final period, going in front by two on a pair of free throws by Anthony Tolliver.
The game remained tightly contested down the stretch. Baynes put in a bank shot with 47.9 seconds left but Gallinari answered with the baseline jumper over Morris that put Denver up by a point with 23.8 seconds remaining.
Detroit's Reggie Jackson, driving the lane against Jokic, missed a contested layup in the final seconds and the rebound came out to the Nuggets, sealing the win.
Everybody thinks to be a great defender as a big guy, you have to be an imposing figure or a great athlete but if you're smart and you know how to position yourself and use angles,'' Denver coach Michael Malone said. ''He had great position. He used his length at the rim. He's in the right place all the time.''
Gallinari connected on a 3-pointer near the end of the second quarter, pulling the Nuggets to 54-45 at halftime. Detroit led by as many as 14 points earlier, using an 11-0 burst that Baynes touched off with a dunk to pull ahead.
A 3-pointer by Morris and a layup by Caldwell-Pope put Detroit up 53-39 with 2:43 left in the second quarter.
Pistons: G Jodie Meeks remains sidelined by a broken bone in his right foot but is nearing a return, perhaps as soon as next week.
Nuggets: G Jameer Nelson missed a fourth straight game because of a sprained left wrist. ... F Kenneth Faried missed the game because of a left groin injury. ... Broncos GM John Elway watched the game from a courtside seat. The Broncos play the New England Patriots on Sunday in the AFC championship game.
Pistons: At Utah on Monday night.
Nuggets: Host Atlanta on Monday night.
This story corrects to Gallinari in short headline.