KISSIMMEE, Fla. — Mike Muscala came up big for his former team.

Muscala ’s three-pointer with 5.2 seconds left lifted the Oklahoma City Thunder to a 116-115 comeback victory over the Miami Heat on Wednesday. That victory enabled the Sixers to get a first-round pick in the NBA draft in October.

The victory ensures the Thunder will pick no higher than 21st in the draft. OKC (44-27) holds the 24th pick in the draft with one more seeding game to play.

The Sixers acquired the Thunder’s draft pick from the Orlando Magic in exchange for Markelle Fultz in a 2019 trade. That same day, the Sixers sent Muscala in a package that included their 2020 first-rounder to the Los Angeles Clippers for Tobias Harris, Mike Scott. and Boban Marjanovic.

But the pick the Sixers received in the Fultz trade was top-20-protected. It would have turned into two second-round picks in 2022 and 2023 if they didn’t get it this summer.

Muscala’s game-winner made sure that didn’t happen. His two three-pointers in the final 34.8 seconds were his only points in the game. Muscala’s first three-pointer knotted the score at 113. His second one put the Thunder up by one point, before Miami’s Tyler Herro missed a deep three-pointer at the buzzer.

The Thunder will conclude the seeding-game portion of their schedule Friday against the Clippers.