Kawhi Leonard scored 29 points and drilled a jumper from the tip of the key with 0.9 on the clock to lift San Antonio to a 98-96 win over the Orlando Magic on Wednesday night.

LaMarcus Aldridge had 21 points and Patty Mills added 17 points and seven assists for the Spurs, who won their fourth straight game.

Evan Fournier, whose 3-pointer tied the game with 13.3 seconds left, led Orlando with 28 points. Nikola Vucevic had 20 points and 13 rebounds, Victor Oladipo scored 14 and Elfrid Payton had 13 points and seven assists.

Payton missed an open layup at the buzzer that could have tied it.

The Spurs rallied from a 14-point fourth quarter deficit to take the lead 94-93 on a fadeaway jumper by Aldridge with 1:10 left in the game. Leonard added two free throws to up the lead to 96-93 going into the final minute.

San Antonio blocked two shots and forced two turnovers in the final minute, but Fournier made a 3-pointer with 13.3 seconds to tie the game at 96.

After a Spurs timeout, Leonard dribbled the clock down to the final second, rose up over Magic defender Aaron Gordon and buried the game winner.

The Magic led 81-67 early in the final period when they went into one of their familiar fourth quarter fades. Orlando started giving up second-shot chances and open 3-pointers and the Spurs accepted both, scoring nine points on each.

Green, Mills and Leonard split the Spurs first 21 points of the quarter with seven each as San Antonio methodically clawed its way back. Mills made a driving layup to cut the deficit to 91-88 with 4:30 left in the game.

The Magic were down 60-57 in the middle of the third period when Fournier ignited a 22-7 fun to finish the quarter. The Magic's best perimeter scorer started the run with a 3-pointer, followed with a 3-point play, made a pull-up jumper and two free throws as the Spurs lost interest at both ends of the floor.

San Antonio lost all rhythm at the offense, hitting just seven of 26 shots (27 percent) in the quarter. Three of the makes were 3-pointers, which meant the Spurs only faced a 79-67 deficit going into the final period.

TIP-INS:

Spurs: San Antonio started the game 1-for-9 from the field, then hit 11 of its last 12 shots in the first period. .... Tim Duncan (sore knee) returned to the starting lineup after missing eight games with a sore knee. He played only 18 minutes, none in the fourth quarter. ... Tony Parker and Manu Ginobili did not play. ... The Spurs win percentage, 84.9 (45-8) is the best in franchise history going into the All-Star break.

Magic: SF Tobias Harris (ankle) missed his third straight game. ... Reserve C Jason Smith sat out the game with a bad back. ... Orlando is just 15-40 (27.2 percent) against San Antonio. . Aaron Gordon had 14 rebounds, but scored only four points. ... Dewayne Dedmon had nine rebounds in 10 minutes.