Photo: Orlando Magic/X

The Orlando Magic survived the Dallas Mavericks 115-114 with Wendel Carter Jr. making a go-ahead dunk with 1.4 seconds left on Thursday night.

Flagg hit a three-pointer with 37.3 seconds left to have a four-point cushion for Dallas, but the Magic scored the last five points when Jalen Suggs made a three-pointer with 32.2 seconds left.

After Flagg missed a jumper, Suggs fed Carter in the paint for the slam.

Tristan da Silva led the Magic with 19 points, Suggs finished with 17 points and seven assists, while Paolo Banchero had 16 points and 12 rebounds. Carter scored 15. 

Flagg had 18 points, five rebounds, six assists, and four blocks in 26 minutes on his return after he missed the previous eight games with a sprained left foot.

The 19-year-old joined Michael Jordan and Luka Doncic as the only players since the 1976 NBA-ABA merger with 1,000 points, 300 rebounds, and 200 assists in his first 50 games.

Dallas sharpshooter Klay Thompson dropped 24 points, coming off the bench made seven three-pointers, while Khris Middleton had 19 points, but lost for the 15th time in 17 games.

Meanwhile, the Mavericks played without Brandon Williams due to a left quad contusion.

Up next: the Mavericks at Boston on Friday, while the Magic at Minnesota on Saturday.