Tracy McGrady reached 40 points for the third time in six days as the Orlando Magic snapped a three-game losing streak with a 105-100 win Thursday night over the Golden State Warriors.

McGrady went 19-of-30 from the field and also had seven rebounds. He reached 40 points on a two-handed dunk with 48 seconds left for a 12-point lead.

The Warriors scored four quick baskets to rally within 100-96 with 15.9 seconds left, but Horace Grant converted a three-point play to seal Orlando's fourth straight win over Golden State.

Mike Miller had 15 points, eight assists and six rebounds for the Magic, who got their first victory on a six-game road trip.

Orlando was playing its fifth game in seven days, but McGrady -- who scored 40 against Atlanta last Friday and 47 against the Clippers on Monday -- barely seemed to break a sweat. He had 13 points in the second quarter, and he scored six straight in the fourth.

Antawn Jamison scored 21 of his 25 points after a foul-plagued first half for the Warriors, who have lost four straight and eight of nine, dropping into last place in the Pacific Division.

Larry Hughes had 18 points, eight assists and eight rebounds. Erick Dampier, who also had foul trouble, dominated the Magic's centers with 21 points and 10 rebounds.