Evan Fournier scored 24 points, Elfrid Payton added 20 off the bench and the Orlando Magic beat the Miami Heat 116-107 on Monday night to snap a four-game losing streak.

Serge Ibaka scored 17 points and Nik Vucevic finished with 13 points and 17 rebounds for Orlando, which swept two games in Miami for the first time since 2007-08.

Fournier scored nine points in the fourth quarter, including a 3-pointer with about a minute left to put Orlando up by six.

Dion Waiters returned from a sprained ankle and scored 23 points for Miami, whose eight-game home winning streak was snapped. Goran Dragic scored 22 points for the Heat, who have lost two straight following a 13-game winning streak.

James Johnson scored 15 points and Hassan Whiteside grabbed 19 rebounds for the Heat, who were outrebounded 52-37.

The Heat hadn't trailed by more than 11 at home in 2017, and the Magic changed that quickly, leading by 12 before the first quarter was over and as many as 14 in the first half. Dragic beat the clock with a layup to cap a 14-3 run, and Miami got within 60-57 at the half.

Miami led by four early in the fourth, before Mario Hezonja and Payton combined for a 9-0 run that put Orlando up for good. Waiters made a stepback jumper with 1:14 left to get the Heat within three, but Fournier's 3-pointer on the next possession put the Magic back in total control.

TIP-INS

Magic: After shooting 26 for 110 from 3-point range in their last four road games, the Magic were 8 for 14 from deep. ... Orlando started 10 for 10 from the foul line, then missed six of its next eight. ... The Magic surprised 17 nonprofit community groups in Central Florida with donations totaling $1 million last week, the ninth time the team's youth foundation has managed to do so.

Heat: Miami led for a total of 21 seconds in the first three quarters, then for another 1:57 in the fourth. ... Johnson was scoreless until 1:35 remained in the third, then scored nine points in 90 seconds. ... This was Miami's lone home game between Feb. 4 and Feb. 25.

GORDON RETURNS

Aaron Gordon was back in Orlando's lineup after missing two games with a bone bruise on his right foot. He's still planning to compete in the dunk contest on All-Star Saturday night in New Orleans. Monday marked exactly one year since Gordon lost the dunk contest to Minnesota's Zach LaVine at Toronto's All-Star weekend.

RICHARDSON CLOSE

Heat guard Josh Richardson, who hasn't played since Jan. 6 because of a sprained left foot, is close to returning. He'll accompany the team on its trip to Houston and may play Wednesday. If not, then Feb. 24 at Atlanta would seem certain, barring a setback.

UP NEXT

Magic: Host San Antonio on Wednesday. Orlando plays seven of its next eight at home.

Heat: Visit Houston on Wednesday. It's Miami's final game before the All-Star break.