ORLANDO, Fla. (AP)De’Aaron Fox beat the buzzer from just inside halfcourt to give the Sacramento Kings a 126-123 overtime victory against the Orlando Magic on Saturday night after the Kings wiped out a 20-point deficit in the third quarter.

Fox’s 37 points included the first six in overtime. The Kings needed three more at the end after throwing away a pass in the backcourt with 6.6 seconds left, allowing the Magic’s Chuma Okeke to tie the game with a dunk.

Fox then dribbled the ball up and launched his shot with his feet inside the Magic logo at center court, a shot that was officially listed at 31 feet.

”I just tried to get as in front of the basket as I possibly could, and just tried to get it up,” Fox said. ”It felt good, and it went in.”

Paolo Banchero led Orlando with 33 points and 16 rebounds. Franz Wagner added 31 points and six assists, and Bol Bol finished with 23 points and seven rebounds.

Domantas Sabonis had 25 points and 11 rebounds for the Kings.

With Fox scoring 13 points in the period, the Kings wiped out a 20-point deficit in third quarter after Orlando shot 60.5% and scored 65 points in the first half.

”I just told our guys basically at halftime: `We’re better than this,”’ Sacramento coach Mike Brown said. ”I said, `I don’t care if we win or lose the game, but the way we’re playing, that’s not us. Let’s at least go out there and fight.’ And to their credit, they did.”

After Banchero’s baseline jumper put Orlando up by 20 early in the quarter, the Kings outscored the Magic 36-10 the rest of the period and took an 83-77 lead into the fourth.

”We got within striking distance and then our bench got us up 10,” Fox said. ”It was really a team effort in that second half. But for us as starters, we have to start the game like that so we don’t get ourselves in that predicament.”

Sacramento led 92-82 after Malik Monk’s 3-pointer early in the fourth before going scoreless for more than four minutes.

”We got a little stagnant (in the third quarter) and our jumpers weren’t falling and they just capitalized on every chance they had to make it a close game,” Banchero said. ”But you’ve got to expect that. The NBA is too long of a game to ever get comfortable when you’re up 20 points. These guys are great players. They’re going to get hot and make shots.”

TIP-INS

Kings: Fox played 40 minutes after missing Wednesday night’s game in Miami with a bone bruise. … Monk and Trey Lyles combined for 30 points off the bench, going 7 of 14 on 3-pointers.

Magic: Shot 54.3% for the game, but only 4 of 23 on 3s. … The 7-foot-2 Bol made his first 10 shots before missing a 3-point attempt in overtime. … G Terrence Ross returned after missing almost two full games with a bruised left knee. … G Cole Anthony missed his fifth game with a right oblique tear. The Magic expect him to be out the rest of the month.

GETTING TO THE LINE

Banchero went into the game with 72 foul shots, sixth-most in the NBA. He shot five Saturday, giving him 77 in 10 games.

The only rookie in the last 20 years to rank among the top 10 in free throw attempts was Andrew Wiggins, who attempted 466 for Minnesota in 2014-15 to finish sixth in the NBA.

UP NEXT

Kings: Play at Golden State on Monday night.

Magic: Play at home against Houston on Monday night.

AP NBA: https://apnews.com/hub/NBA and https://twitter.com/AP-Sports