Steve Mills, the general manager of the Knicks, leaned back in his chair and sighed as ESPN went to its final commercial break Tuesday night during the N.B.A.’s annual draft lottery. The order of the top three teams had yet to be revealed, but Mills and the rest of civilization already knew that the Knicks would not be among them.

Mills was soon left alone in his four-person row on the ballroom stage at the New York Hilton, having been abandoned by representatives of the Minnesota Timberwolves, the Los Angeles Lakers and the Philadelphia 76ers, each of whom took a spot at the center of the dais. Mills could only watch the festivities unfold without him.

“There’s a little disappointment, obviously,” he said later.

Months after abandoning any hope of a respectable season in hopes of wooing the lottery gods, the Knicks were instead slapped with the fourth pick in this year’s draft, scheduled for June 25 at Barclays Center. It was not a total disaster — the Knicks could have fallen to fifth — but they had the second-best odds of winning the top pick and are now almost assured of missing out on two potentially franchise-altering big men, Karl-Anthony Towns of Kentucky and Jahlil Okafor of Duke.

Interactive Feature | 2015 Draft Order for Lottery Picks

The Timberwolves, who had finished with the league’s worst record (16-66), won the top pick, followed by the Lakers and then the 76ers. Byron Scott, the coach of the Lakers, pumped his fist on the stage when he learned that his team had leapfrogged the Knicks to secure a top-three pick.

Knicks personnel had practically set up camp at Kentucky this winter to scout Towns and a couple of his teammates.

“We would have liked to have received a higher pick,” Mills said, “but we went into this knowing that anywhere between 1 and 5, we were going to get a good player. And the way we look at this, this is a player that’s complementary to a player that we have in place in Carmelo and what we’re going to do in free agency.”

In referring to Carmelo Anthony, Mills worked to put a positive spin on the evening. He was not wrong to suggest that this draft class is deep, especially at the top of the lottery, featuring several players who could improve teams from the outset.

The list of elite prospects includes two point guards, D’Angelo Russell of Ohio State and Emmanuel Mudiay, a native of the Democratic Republic of Congo who played professionally in China this season. Mills said he had not scouted Mudiay in China, and Mudiay remains a bit of a mystery. But the Knicks are expected to evaluate several players as the draft approaches, and Mills did not rule out the possibility of trading the pick.

“We think he’s a guy who obviously will be in the mix,” Mills said of Mudiay, “but we’re going to look at all of our options.”

Mills, seated alongside representatives of 13 other teams, watched as Mark Tatum, the league’s deputy commissioner, opened 14 envelopes, each containing a team logo. The Knicks, who went 17-65, the second-worst record in the league, had a 19.9 percent chance of winning the lottery and a 55.8 percent chance of being among the top three. But they also had a 31.9 percent chance of dipping to No. 4.

Fran Fraschilla, an analyst for ESPN, said it was not the worst place to be, given the quality at the top of the draft.

“All of these players, in their own way, have skills that are going to translate well to the N.B.A.,” Fraschilla said in a telephone interview.

This draft lottery came 30 years after the Knicks won their first and only top overall pick since the lottery era began that year, 1985. They selected Patrick Ewing, who turned out to be a transformative force for the organization.

The team had no such luck this time around.

Then again, a top-five pick is a luxury for the Knicks, who have a troubling history of trading away picks in ill-advised deals. More recently, they have been hamstrung by salary-cap limitations — code for excessive spending. Still, they will have money to spend after shedding the onerous contracts that belonged to Amar’e Stoudemire and Andrea Bargnani, among others. Mills projected that the team would be $28 million under the cap. He also said that free agency could affect the Knicks’ approach to the draft.

“It’ll have a big impact,” he said. “We’ll look at what kind of guys are going to move in free agency and have our draft plans accordingly.”

On Tuesday, Mills was seated between Glen Taylor, the owner of the Timberwolves, and Nerlens Noel, the young center for the 76ers. Mills wore Dave DeBusschere’s Basketball Hall of Fame ring — the same ring that DeBusschere wore for the 1985 lottery.

The opening of the envelopes was a made-for-television affair, with the actual lottery procedure — a complex sorting of Ping-Pong balls — taking place in a separate room before ESPN’s broadcast.

The Timberwolves, who had a 25 percent chance of securing the top pick, became only the fifth team (and the first since 2004) to finish with the N.B.A.’s worst record and win the lottery that same year. The Knicks were guaranteed to stay in the top five, a consolation prize after trudging through an injury-marred, stomach-churning season.

“We’re going to get a good player,” Mills said. “We’re going to continue with our process.”