Markelle Fultz created the sixth lead change of the fourth quarter with a driving layup with 2:22 remaining, and the Orlando Magic held on to defeat the visiting Golden State Warriors 100-96 Sunday night.

Evan Fournier scored a game-high 32 points for the Magic, including a layup that extended a one-point lead to 98-95 with 9.3 seconds left.

The Magic then intentionally fouled Alec Burks, and he made only one of the two foul shots, leaving the Warriors still two points down with 6.3 seconds remaining.

Golden State then got a break when the Magic couldn’t inbound the ball within five seconds and gave the ball back to the Warriors.

The league’s losingest team went for a rare win, but Burks’ 3-point attempt from the left wing hit off the back of the rim, allowing the Magic to close out the victory with two Aaron Gordon free throws with four-tenths of a second left.

The Warriors made just six of their 23 3-point attempts in the game and were outscored 33-18 on 3s by the team that entered the contest with the NBA’s worst 3-point shooting percentage.

Fournier’s 32 points came 13-for-21 shooting overall and 6-for-10 on 3-pointers as Orlando won for just the second time in its last six games.

The win, Orlando’s seventh in 11 home games this season, was the Magic’s second straight over the Warriors after they ended an 11-game losing streak to Golden State last February.

Terrence Ross chipped in with 19 points for the Magic, while Jonathan Isaac recorded 14 points and a team-high 11 rebounds, Fultz had 14 points to complement a game-high nine assists, and Khem Birch totaled 10 rebounds.

Glenn Robinson III paced Golden State with 19 points as the club lost a second straight to start a five-game trip. Eric Paschall had 17 points, Burks 15, Ky Bowman 12, and Willie Cauley-Stein and Draymond Green 11 apiece.

Cauley-Stein completed a double-double with a game-high 12 rebounds for the Warriors, who trailed by as many as 12 in the first half.