Serge Ibaka's baseline jumper with less than a second remaining gave the Orlando Magic a 119-117 win over Russell Westbrook and the Oklahoma City Thunder on Sunday night.

Ibaka, who was traded from the Thunder to the Magic in the offseason, scored a career-high 31 points and added nine rebounds and four blocks.

With the score tied in the final minute, Westbrook missed a pull-up jumper, and Orlando rebounded and called timeout with 11 seconds remaining to set up Ibaka's winner with 0.4 seconds left.

Westbrook finished with 41 points, 16 assists and 12 rebounds for his third triple-double of the season and 40th of his career. The Thunder had won 20 straight when Westbrook tallied a triple-double.

Elfrid Payton scored 23 points and Evan Fournier added 21 for the Magic, who snapped a three-game losing streak.

It was the third straight loss for the Thunder, all at home, after a 6-1 start.

Oklahoma City's Victor Oladipo, who came to the Thunder in the Ibaka deal, scored 12 points.

The Magic led by 21 in the second quarter and were up 57-47 at halftime. Ibaka scored 19 points before the break to match Westbrook's 19 points.

The Thunder rallied late in the third quarter. A putback by Enes Kanter with 1:35 left in the third quarter tied the game at 80. Oklahoma City led 84-82 heading into the fourth quarter.

The Thunder had one last shot after Ibaka's jumper, but Nick Collison couldn't quite connect on a lob to Westbrook.

TIP-INS:

Magic: Ibaka was cheered loudly during pregame introductions. He acknowledged the fans by twice raising both arms to the sky. ... Ibaka had 13 points, six rebounds and four blocks in the first quarter.

Thunder: Oklahoma City made 6 of 25 shots in the first quarter and missed all eight of its 3-pointers to fall behind 27-13. ... The Thunder made 14 of 21 shots in the third quarter and outscored the Magic 37-25. ... Domantas Sabonis, also acquired in the Ibaka deal, started and scored three points on 1-for-6 shooting.

UP NEXT:

The Magic play at coach Frank Vogel's former team, the Indiana Pacers, on Monday.

The Thunder play at Detroit on Monday.