CHICAGO (AP) - Orlando Magic president of basketball operations Jeff Weltman was supposed to be at the podium for the NBA draft lottery.

He benched himself in favor of coach Jamahl Mosley.

“I haven't been very good at this,” Weltman said. “Coach was feeling lucky and we let him roll the dice. Tonight, he's the Coach of the Year.”

And next season, he'll be coaching the No. 1 pick.

The Magic won the lottery Tuesday night and landed the top overall pick for the first time since they got Dwight Howard in 2004.

“We're all just rooting for our team and hoping that number pops up the right way,” Weltman said. “But teams are built on these breaks.”

The Magic got a huge one, with lottery luck striking the franchise for the fourth time. Orlando also won in back-to-back years in 1992 and 1993, taking Shaquille O'Neal and then trading the rights to Chris Webber for Penny Hardaway.

The Magic finished with the worst record in the Eastern Conference at 22-60 in their first season under Mosley and missed the playoffs for the eighth time in 10 years. But they got a huge win in the lottery, where they had a 14% chance landing the top pick.

“These are hard seasons when you're not winning and that takes a lot out of you and you have to carry your belief in your team and your players and the organization through,” Weltman said. “So when you get a break, it helps, and that's how that's how teams are built. So tonight is a good night for us.”

Duke's Paolo Banchero, Gonzaga's Chet Holmgren, Purdue's Jaden Ivey and Auburn's Jabari Smith are widely considered the most likely candidates to be taken first. The draft is June 23 in New York.

Oklahoma City got the second pick, followed by Houston and Sacramento. The Kings moved up from the No. 7 spot entering the lottery.

Detroit picks fifth, with Indiana, Portland, New Orleans, San Antonio and Washington rounding out the top 10. The rest of the lottery results are: New York, Oklahoma City, Charlotte and Cleveland.

The lottery, with 14 ping pong balls numbered 1 through 14 placed into a hopper, sets the first four picks. The remainder of the non-playoff teams go in reverse order of their finish.

Houston, Orlando and Detroit had the best odds of winning the lottery at 14%. All three had young teams that finished at the bottom of the NBA, with the Magic having 2021 lottery picks Jalen Suggs and Franz Wagner on their roster.

“It feels great,” Weltman said. “I'm so happy for our fans. They really stuck with us. And nights like this help, where you can really show the fruits of why you go through these phases and these cycles. And hopefully, they're really excited by this.”

The Magic are committed to building through the draft after trading veterans Nikola Vucevic and Aaron Gordon in March 2021 for first-round draft picks in 2023 and 2025. But they were missing two of the young players they are trying to build around last season with Jonathan Issac and Markelle Fultz recovering from knee injuries.

With the No. 1 pick and a new practice facility set to open in a few weeks, the Magic have some things going for them at the moment.

Banchero, Holmgren and Smith decided to turn pro after one college season while Ivey spent two years at Purdue.

The 6-foot-10, 250-pound Banchero was viewed as a likely one-and-done player before he arrived at Duke from Seattle as part of a talented recruited class. He lived up to it, helping the Blue Devils reach now-retired coach Mike Krzyzewski's record 13th Final Four before losing to archrival North Carolina.

With his strength and perimeter skills, Banchero averaged 17.2 points and 7.8 rebounds. He scored 20 or more 15 times while failing to reach double figures only twice in 39 games.

Holmgren, a 7-footer with the ability to pass and handle the ball like a guard, was one of the most highly touted recruits ever for Gonzaga. He was the West Coast Conference newcomer of the year, defensive player of the year and a first-team all-conference selection. He averaged 14.1 points, 9.9 rebounds and 3.6 blocks per game, and was a third-team AP All-American.

Smith also lived up to his billing as one of the top recruits ever for Auburn. The Tigers earned their first No. 1 ranking and spent three weeks in the top spot. The 6-10, 220-pounder from Fayetteville, Georgia, was a second-team, All-American and the SEC freshman of the year. He led Auburn in scoring, averaging 16.9 points and 7.4 rebounds. Smith was also the Tigers' top 3-point shooter after making 79 of 188 attempts (43%).

The rest of the first round is slotted this way: Charlotte at No. 15, followed by Atlanta, Houston (from Brooklyn through the James Harden trade), Chicago, Minnesota, San Antonio, Toronto, Denver, Memphis, Philadelphia (may be conveyed to Brooklyn), Milwaukee, San Antonio, Dallas, Miami, Golden State, Memphis and Oklahoma City.