LAS VEGAS (AP) — The Orlando Magic led by 18 points with less than five minutes left in regulation of their NBA Summer League against the Sacramento Kings on Saturday, well on their way to a victory.

They wound up getting that win — after some very wild events down the stretch.

Emanuel Terry’s layup off a pass from No. 1 pick Paolo Banchero gave the Magic a 94-92 victory in sudden-death overtime, capping a frantic finish to a game that had a little bit of everything in the final moments.

“That’s a game I’ll probably never, ever forget,” Magic summer coach Jesse Mermuys said.

With good reason. Sacramento closed regulation on a 23-5 run, getting the last six of those points in the final 5.1 seconds on a pair of 3-pointers to force overtime.

The fun was just getting started.

Keon Ellis banked in a 3-pointer with 22 seconds left in the first 2-minute overtime, putting Sacramento up 92-89. But the Kings fouled Devin Cannady with 6.2 seconds left, and he swished all three free throws to tie it.

Ellis missed a short jumper with a second left in OT, and Cannady nearly won the game there with a 60-foot heave that bounced off the rim. That sent the teams to a second overtime, sudden death, first score wins.

Banchero was called for a foul on the first Sacramento possession and the Kings would have gone to the line to shoot free throws — but after a lengthy review, the call was overturned. Orlando got the ball, Banchero found Terry down low, and the Magic got their winner.

“This was one of the most fun games I’ve ever been a part of,” Cannady said. “I’ve played in the NCAA Tournament, obviously I’ve played in NBA games, but this was basketball at its purest.”

Banchero scored 23 points for the Magic and had six rebounds, six assists and four steals. Admiral Schofield scored 14 points for Orlando.

Neemias Queta topped Sacramento with 23 points. Keegan Murray, the No. 4 pick, scored 20 points and grabbed nine rebounds. Queta hit the first 3-pointer in the final moments of regulation to give Sacramento a chance, and Murray made the tying one with two-tenths of a second remaining.

RAPTORS 97, 76ERS 77

Armoni Brooks made five 3-pointers and scored 25 points, Delano Banton added 21 and Toronto breezed to a victory over Philadelphia.

Christian Koloko, the Raptors’ only pick in this year’s draft, added 12 points and seven rebounds. The No. 33 overall pick added three steals and three blocks.

Isaiah Joe buried 7 of 9 shots from 3-point range, scoring 24 points to pace the Sixers.

HEAT 88, CELTICS 78

Mychal Mulder scored 23 points to help Miami beat Boston.

Mulder made 5 of 8 shots from 3-point range for the Heat. Serbia’s Nikola Jovic, the 27th overall selection and Miami’s only pick in the draft, missed two free throws and his only shot attempt. He grabbed four rebounds in just under 14 minutes of action.

Matt Ryan topped Boston with 15 points, and Mfiondu Kabengele had 14. JD Davison, the Celtics’ only pick in the draft (53rd overall), finished with 10 points, six rebounds and six assists.

PISTONS 105, WIZARDS 99

Isaiah Livers scored 20 points in Detroit’s victory over Washington.

Jalen Duren, the 13th overall pick whom the Pistons acquired in a draft-day trade with Charlotte, had 13 points and six rebounds. Jaden Ivey, the fifth overall selection, scored 11 points in a little over five minutes of action before leaving because of a sprained right ankle.

Jordan Schakel had 24 points, and Jordan Goodwin had 20 to pace Washington. Johnny Davis — the 10th overall pick — finished with six points and five rebounds.

JAZZ 72, HAWKS 66

Jared Butler had 15 points and seven assists to lead Utah past Atlanta.

Kofi Cockburn added 13 rebounds and six points for the Jazz.

Chaundee Brown Jr. scored 15 poins to lead Atlanta. Justin Tillman added 12. A.J. Griffin, the Hawks’ top pick at No. 16, did not play.

ROCKETS 90, THUNDER 88

No. 17 overall pick Tari Eason made the second of two free throws with 4.1 seconds left and Houston held off Oklahoma City.

Eason finished with 14 points and 11 rebounds for the Rockets. No. 3 overall pick Jabari Smith had 12 points, nine rebounds and four steals. Josh Christopher had 19 points, nine rebounds and five assists.

Jalen Williams, one of OKC’s three first-round draft picks, topped the Thunder with 15 points. No. 2 overall pick Chet Holmgren had 12 points, eight rebounds and four blocks. Ousmane Dieng — the 11th overall selection acquired in a trade with the Knicks — added 10 points and six rebounds.

CLIPPERS 94, GRIZZLIES 76

Reggie Perry had 17 points and Brandon Boston Jr. scored 15 to lead Los Angeles past Memphis.

Second-rounder Moussa Diabate, the Clippers’ only pick in the draft, had 10 points and six rebounds.

Kenneth Lofton Jr. topped Memphis with 18 points. First-round pick David Roddy had 10.

TRAIL BLAZERS 85, PELICANS 68

Trendon Watford had 17 points, 11 rebounds and five assists to power Portland past New Orleans.

Second-round pick Jabari Walker finished with 12 points and five rebounds for the Trail Blazers.

Trey Murphy III had 23 points, eight rebounds and four steals for the Pelicans. No. 8 overall pick Dyson Daniels missed all five of his shots and 1 of 2 free throws. Second-rounder E.J. Liddell scored two points on 1-for-6 shooting.

___

More AP NBA: https://apnews.com/hub/NBA and https://twitter.com/AP_Sports