NEW YORK _ The lockout is settled, the season is saved and the NBA has survived.The most divisive labor battle in league history finally ended at dawn Wednesday on the 191st day of the lockout when commissioner David Stern and union director Billy Hunter compromised on the remaining issues keeping them apart and shook hands on a collective bargaining agreement.The deal still has to be reduced to writing, meaning the lockout hasn't yet officially been lifted.But barring any unforeseen snags, the season will begin no earlier than Feb. 2, with each team playing no more than 52 games."We can exhale now, without a doubt," said Alonzo Mourning of the Miami Heat. "The deal is done and we can just focus our mind right now on starting back up again."The agreement was reached just 29 hours before the NBA Board of Governors was to vote on canceling the remainder of the season. It came during an all-night bargaining session at NBA headquarters between Stern and Hunter. Union president Patrick Ewing was not present."Did we blink? I guess we both blinked," Hunter said.Said Stern: "I will say that I am elated that we will be playing basketball this season."Each side made significant compromises to close the deal, but the owners clearly walked away with a much better agreement than the old one. The players, for their part, came away with their dignity intact and with more money for the non-superstars.Hours later, the deal was ratified by players in a 179-5 vote after being approved by both negotiating committees. It gives owners the unprecedented concession of a maximum limit on individual salaries and will be in place for six years, with owners having an option for a seventh year."Oh, I'm so relieved it's unbelievable," Milwaukee Bucks coach George Karl said. "It's like I let a balloon out of my stomach. The knots are already loosening up in my neck. I get to do what I love to do."The Board of Governors scheduled a vote on the agreement for this morning, and the league said it would not comment until then. The process of putting the agreement on paper could take 10 days, meaning training camps would open around Jan. 17.Once the deal is finalized, it will unleash a three-week frenzy of teams scrambling to fill rosters, make trades and sign some of the 200 free agents while running abbreviated training camps.Among the free agents are Michael Jordan, Scottie Pippen, Dennis Rodman, Charles Barkley, Antonio McDyess, Rod Strickland and Damon Stoudamire."We'll probably have eight months of NBA basketball squeezed into four months, with trades and signings," Karl said.Under terms of the new agreement, a grandfather clause allows any player to re-sign with his team for 105 percent of his previous salary. That means Jordan, who made about $33 million last year, could get about $34.7 million from the Bulls.No other team can offer him more than $14 million."Michael is going to analyze the deal, see what Chicago wants to do and then make an informed decision," agent David Falk said. "I'm not certain what his time frame is."Once the games get started, players will be faced with an exhausting schedule until playoffs start in late April. Teams will be asked on occasion to play three games in three nights, something that hasn't happened in the last 10 years."It's going to be tough to play back-to-back-to-back games, but that's something we have to do as athletes," Jimmy Jackson, a free agent who last played for Golden State, told The New York Times. "But if you love the game, you'll do whatever it takes to be ready to play."After the deal was ratified, Stern spoke to the almost 200 players who had flown in to vote on the owners' latest proposal _ a vote that never came."He told us Billy was a tough guy, but a good guy, and how glad he was to get it over with and to start playing again," Aaron Williams of the Seattle SuperSonics said.Witnesses said the players' response was polite, but not enthusiastic.The players did, however, give Hunter and Ewing a standing ovation.The union agreed to accept 55 percent of about $2 billion in annual revenue in the fourth, fifth and sixth years of the agreement, according to several sources involved in the talks who spoke to The Associated Press on condition of anonymity.Players would get 57 percent if the league exercises its option for the seventh year. In the first three years, there is no limit on the percentage of revenues players can receive.Also, the agreement includes a ban on marijuana, with all players undergoing drug testing once per season, and tougher player discipline penalties and conduct rules.The sides also agreed to form a joint committee of three owners and three players to discuss the growth of the league and improving the relations between players and management.Among other compromises:_ The union agreed to a $14 million maximum salary for players with 10 years' experience. Players with one to five years' experience can get a maximum of $9 million, and players with six to nine years' experience can get $11 million._ The union agreed to a three-year rookie scale with teams holding an option for the fourth year and the right of first refusal in the fifth year. First-round draft picks will be grouped into three categories by where they were selected _ 1-9, 10-19 and 20-29 _ with the highest picks eligible for higher percentage increases in their salaries from year to year._ The league accepted the union's proposal for an "average" salary exception and "median" salary exception, with both being phased in during the next three years. As a result, every team will have the right to sign two additional players each season, even if they are over the salary cap._ The league agreed to higher minimum salaries than it had been offering, but not quite as high as the union had been demanding.No professional sports union had ever agreed to a maximum salary before, but the NBA pushed for one throughout the lockout. The union initially refused, then suggested a luxury tax be charged to any owner who signed a player for more than $15 million. The league kept holding out, and eventually the players relented.NBA players have the highest average salary in professional sports, about $2.6 million annually, and the median salary is about $1.3 million. NFL players average about $900,000, and major league baseball pays an average of $1.45 million."Guys can still make $14 million, and that's a lot of money," said Kevin Willis of the Toronto Raptors. "If you can't live off that, something's wrong."The league and the union had been fighting over how to divide the estimated $2 billion in annual revenue.The lockout went into effect July 1, just 2 1/2 weeks after Jordan and the Bulls won their sixth championship in a riveting Game 6 that put up the largest TV viewer numbers ever for the NBA Finals.Since the 1980s and especially since Jordan arrived, the league has enjoyed unprecedented popularity here and abroad. On the labor front, Stern and the NBA lived a relatively charmed life, while baseball struggled through a strike that caused thousands of fans to turn away from the sport.But then came the lockout that for the first time caused the NBA to miss games because of a labor dispute. The first three months of the season were scrapped and players lost about $500 million in salaries.An entirely new schedule will be put in place for the remainder of the 1998-99 season, although details were still unavailable."All I can do is tell the fans," Mourning said, "that I'm sorry about the inconvenience. I appreciate their patience, and I'm sorry about any of the bad impressions that they've gotten from this whole ordeal, but that's what business is all about."We knew that going into this thing that we were gonna step on some peoples' toes and upset some people, but we had to do what's best for the guys in this league."