The Oklahoma City Thunder led for most of the game, but saw Orlando outscore them 23-14 in the final quarter, and the Magic got a dunk from Tobias Harris as time expired to beat OKC 103-102 on Friday night at the Amway Center in Orlando, Florida.
OKC was up 102-101 in the final 30 seconds with the basketball, when Kevin Durant missed a fallaway jumper.
The long rebound was snagged by Victor Oladipo, who started a fast break for the Magic, passing to Maurice Harkless, who fed the trailing Tobias Harris for the dunk with one-tenth of a second left to win it for the Magic.
Durant led the Thunder with 29 points and added 12 rebounds, while Serge Ibaka scored 26 points on 10 of 13 field goal shooting.
The Thunder shot over 70 percent from the field in the first quarter, and shot nearly 51 percent for the game.
Harris led Orlando with 18 points.
OKC led by as many as 17 points in the second quarter, but lost for the second straight game on the road against an Eastern Conference team after winning their first nine of the season.
The Thunder fell to 40-12 on the season.
OKC hosts the New York Knicks Sunday at noon at Chesapeake Arena.