As a frantic Black Friday gave way to a sleepy Saturday morning in Midtown Manhattan, the biggest deal of all was consummated in a law office tucked between F. A. O. Schwarz and the Apple Store.

With handshakes, sighs and weary smiles, the N.B.A. and its players resolved a crippling labor dispute, allowing them to reopen their $4 billion-a-year business in time for the holidays. A 66-game season will start on Christmas Day, ending the second-longest lockout in league history.

The deal was reached at about 3 a.m. Saturday, on the 149th day of the lockout, after a final 15-hour bargaining session at the law offices of Weil, Gotshal and Manges.

“We’ve reached a tentative understanding that is subject to a variety of approvals and very complex machinations,” the league’s commissioner, David Stern, said at 3:40 a.m., “but we’re optimistic that that will all come to pass, and that the N.B.A. season will begin on Dec. 25, Christmas Day, with a tripleheader.”

Training camps and free agency will open, simultaneously, on Dec. 9, giving teams two weeks to prepare.

The three Christmas games are likely to be the ones that were already on the schedule: Boston Celtics vs. the New York Knicks, followed by the Miami Heat vs. the Dallas Mavericks and the Chicago Bulls vs. the Los Angeles Lakers. The rest of the schedule will be reconstructed and released in the coming days.

“We’re really excited,” said Peter Holt, the San Antonio Spurs owner and chairman of the league’s labor-relations committee. “We’re excited for the fans. We’re excited to start playing basketball, for players, for everybody involved.”

The 66-game season will be the second shortest in the modern era, following a 50-game season in 1999, which also occurred after a lengthy lockout. Teams will play a compressed schedule, and the season will be extended into late April. The season had been scheduled to begin Nov. 1. The playoffs and finals will also be pushed back.

But much needs to be done before the basketballs hit the court.

Officials on both sides must still negotiate myriad so-called B-list issues, including drug testing, the age limit and use of the Development League, and the entire collective bargaining agreement must be formally constructed.

The deal needs to be ratified by a simple majority of the 30 teams and a simple majority of the 430-plus players. Before that can happen, the parties must dispense with two pending lawsuits, and the players must reconstitute their union, which was dissolved on Nov. 14.

Both Stern and Billy Hunter — the head of the National Basketball Players Association — expressed confidence that the deal would be approved. Because of the early hour, the deal had not been shared with crucial committees on each side, and officials demurred on any questions about the details.

typing