The Celtics finished the season with a 53-29 record, earning the No. 1 seed in the Eastern Conference. But they still entered Tuesday night with a 25 percent chance of landing the top selection, the best odds in the field, because they had the right to swap picks with the Brooklyn Nets, who finished an NBA-worst 20-62, thanks to the 2013 draft-night deal that sent Kevin Garnett, Paul Pierce and Jason Terry to Brooklyn. Then-Nets general manager Billy King swung that deal in hopes of building a veteran-heavy, championship-level squad that could go toe-to-toe with the LeBron James/Dwyane Wade/Chris Bosh Miami Heat.

That, um, didn’t work out so well for Brooklyn, but it’s panned out beautifully for Boston. The Nets have cratered as the Celtics have climbed over the past few years, with Boston developing into a conference finalist that already has one of the sport’s most explosive scorers in Isaiah Thomas, a do-everything max-contract big man in Al Horford, an All-Defensive Team wing in Avery Bradley, and a slew of versatile pieces to carry out head coach Brad Stevens’ game plans.

Celtics: 3rd team to have best record in conference & No. 1 pick in upcoming draft (1977-78 Trail Blazers, 1981-82 Lakers)

Now, Celtics general manager Danny Ainge can take whichever potential game-breaking prospect his heart desires — Washington point guard Markelle Fultz, UCLA point guard Lonzo Ball, Duke forward Jayson Tatum, or any other player who strikes his fancy — with an eye toward making the Celtics a title contender for years and years to come. (And here’s where we remind you that the Celtics get Brooklyn’s unprotected first-round pick next year, too.) Or, if he prefers, the always-negotiating Ainge can open the top pick up for bids, and see if any team who might be looking to move a superstar-level player — say, the Chicago Bulls (Jimmy Butler) or Indiana Pacers (Paul George)? — is willing to come to the table to talk trade before June’s draft.

“This is pretty good,” said Celtics part-owner Wyc Grousbeck, the team’s representative at the lottery drawing in New York on Tuesday night. “It’s a good time to be a Celtics fan. I wish the draft were today, and we could get a little help for tomorrow night. This is a great night. We really appreciate it.”

Pierce, who is retiring from the NBA after this season, took to Twitter to crack a joke about the blessings he continues to bestow on the franchise with which he made his Hall of Fame name:

And look what I leave behind for the Celts on my way out #1 pick????????????????????

It’s the third straight year that the team with the highest overall odds of landing the No. 1 pick actually came away from the lottery with the top selection. Last year, the league-worst Philadelphia 76ers landed the No. 1 pick, using it on LSU forward Ben Simmons. The year before that, the league-worst Minnesota Timberwolves grabbed No. 1, and Kentucky center Karl-Anthony Towns.

The Los Angeles Lakers kept their top-three protected pick, and will choose No. 2 overall. For the third straight year, the Lakers have managed to avoid sending the Philadelphia 76ers the first-round pick they owed through a pair of past trades — the 2012 deal that sent Steve Nash from Phoenix to Los Angeles, and the 2015 three-way dance that shipped Michael Carter-Williams to the Bucks, Brandon Knight to the Suns and that protected future selection to Philadelphia.

That, as you might expect, made new Lakers president of basketball operations Magic Johnson very happy:

It also means, though, that they will get to keep their 2019 first-rounder, which would have been shipped to the Orlando Magic to satisfy the obligations of the 2012 trade that brought Dwight Howard to L.A. had the Lakers lost this year’s pick. Instead, the Lakers will owe the Magic their 2017 and ’18 second-round picks.

The 76ers round out the top three, though they did not land there with their own 2017 first-round selection. The Sacramento Kings, who entered the night in No. 8 lottery position, actually leapt up into the top three, pushing the Phoenix Suns down to No. 4. The Sixers’ own pick landed at No. 5.

BUT! If the Kings landed in the top 10, the Sixers owned the right to swap spots with Sacramento and take the higher selection, thanks to the July 2015 trade that sent Nik Stauskas, Jason Thompson and Carl Landry to Philadelphia to clear up salary-cap space so the Kings could go free-agent shopping. So when Philly came in fifth and Sacramento landed third …

As a result of the Kings (and, thus, the Sixers) jumping into the top three and knocking the Suns down two spots, the Magic, Timberwolves and New York Knicks all dropped one spot from their pre-lottery odds. The Kings also snagged the No. 10 pick from the New Orleans Pelicans, as part of the All-Star Sunday night deal that sent DeMarcus Cousins to the Big Easy and 2016 lottery pick Buddy Hield to Sacramento.