DENVER - Randy Foye hit a go-ahead 3-pointer with 21 seconds left and the Denver Nuggets rallied to beat the Indiana Pacers 129-126 on Sunday night.

The Nuggets came back in the second half to get their seventh straight win at home over the Pacers. Danilo Gallinari had 23 points and Will Barton had 21, including two free throws with 6 seconds left to help seal it.

Indiana led 119-116 after rookie Myles Turner hit 1 of 2 free throws.

Barton, who scored 15 point in the fourth, tied it at 119 with his third 3-pointer of the game. The teams traded baskets and missed free throws before Foye hit the tiebreaking 3.

The Pacers hit three free throws and Barton a pair to make it a 3-point game. Paul George missed a 3-pointer in the final seconds that would have tied it.

Turner scored a career-high 25 points, Monta Ellis had 24 and George added 19 for the Pacers. Indiana, which has lost three straight, remained winless in Denver since 2007.

The Pacers had just 10 players available but nearly pulled out the win.

The Nuggets bounced back from a disappointing Friday to Miami, which didn't have Dwyane Wade in the lineup. Denver is now 3-1 on its current eight-game homestand.

The Pacers shot 66 per cent in the first half and were 7 of 10 from 3-point range. Ellis had 15 points for Indiana, which led 66-54 at halftime.

The Pacers cooled off to start the third and Denver rallied to take an 80-78 lead. Indiana responded with a 13-4 run to go in front 91-84 after three.

The lead grew to 10 early in the fourth but Denver went on a 14-5 run to take a 106-105 lead on Barton's 3-pointer.

TIP-INS

Pacers: The 66 first-half points were a season high. ... G George Hill was not available due to a personal reason.

Nuggets: G Jameer Nelson was out with a sprained left wrist. Nelson, who had been dealing with a sore left hip, injured his wrist against Miami on Friday night. ... C Jusuf Nurkic (left knee) missed his second straight game.

UP NEXT

Pacers: At Phoenix on Tuesday night.

Nuggets: Host Oklahoma City on Tuesday night.