The Orlando Magic will select 6th overall in the upcoming NBA Draft.

The Boston Celtics won the NBA draft lottery, capitalizing on a trade they made with the Brooklyn Nets four years ago.

The Los Angeles Lakers were other big winners, moving up one spot to second to hold onto their pick. They would have had to trade it to Philadelphia if it fell outside the top three.

The Celtics will go from No. 1 seed to No. 1 pick after their 25 percent chance of winning came through Tuesday night. They open the Eastern Conference finals at home on Wednesday against Cleveland.

Brooklyn finished with the worst record in the league but the Celtics had the right to swap picks with them from the 2013 draft-night trade that sent Kevin Garnett and Paul Pierce to the Nets.

The 76ers will pick third, while Phoenix fell two spots and is fourth.