The NBA and its players' union yesterday agreed to a new labor contract that raises the minimum age at which players are eligible for the draft to 19 and averts a potentially destructive lockout.

The six-year agreement slashes the length of player contracts and implements a tougher drug policy while guaranteeing the percentage of league revenues paid to players.

"I call it a 50-50 deal," NBA Commissioner David Stern said. "Half of it went our way and half of it went their way."

Stern and National Basketball Players Association Executive Director Billy Hunter announced the pact at a news conference in San Antonio yesterday prior to the sixth game of the NBA Finals between the Spurs and Detroit Pistons.

The NBA's 30 owners were threatening to lock out the players after the current labor agreement expired on June 30, which could have launched a labor war similar to the one that canceled half of the 1998-99 NBA season and crippled the league for years.

Stern and Hunter said they were intent on avoiding a repeat of 1998-99 and the kind of labor strife now underway in the NHL, which this past year became the first major North American sports league to cancel an entire season.

"We agreed almost all the way along the line that this business would suffer greatly from a lockout," Stern said. Hunter said both sides "decided it was time to back away from the abyss and see if we could do a deal."

Stern had sought a restriction limiting rookies to no younger than 20 years of age, even though many of the NBA's brightest stars -- including Kobe Bryant of the Los Angeles Lakers, LeBron James of the Cleveland Cavaliers and Kevin Garnett of the Minnesota Timberwolves -- entered the league directly from high school. Stern said he settled for players being at least 19 and one year out of high school before they are eligible to be drafted by the NBA. The union strongly opposed raising the minimum age from 18 to 19.

"We had some philosophical differences with the union on the point, but at the end, rather than the 20 we asked for, we got a 19, and that was a concession from the union to us on this point," Stern said.

The agreement must be ratified by the league's Board of Governors and by members of the players' union at their annual meeting in Las Vegas next week.

Among the main items the players were seeking was a reduction in the so-called escrow tax under which 10 percent of their salaries are withheld if the amount of revenues devoted to players' salaries exceeds a specified percentage.

Owners had already offered to raise the salary cap from slightly more than 48 percent of revenues to 51 percent, thereby increasing the amount of money each team can spend on player salaries from $43.87 million last year to between $47 million and $50 million next season.

Hunter said the priority for many NBA players was the ability to preserve the guarantees on their contracts, which means owners must pay the players regardless of whether they are injured or cut from the team. Most NFL players do not have guaranteed contracts, although NHL and Major League Baseball players' contracts are guaranteed.

"You talk to the NFL players and they'll tell you the best deal around is the NBA," Hunter said. "They say, 'Wow. We sure wish we had it like NBA basketball players.' "

The average NBA player salary is $4.9 million.

To preserve the guarantees, the players agreed to reduce the maximum allowed length of contracts from seven to six years for players re-signing with their current team and from six years to five years for players signing with a new team. The players also agreed to reduce the rate at which those player contracts increase.

Hunter told players as he made his rounds over the past year that tradeoffs had to be made if they wanted to preserve their guaranteed contracts.

He said that early in the negotiations, owners were willing to offer players a fatter percentage of league revenues if the players would give up the guaranteed contracts, but players wanted the guarantees even if it meant less money. The owners later proposed shortening the length of contracts from seven and six years to four and three, then it became five and four, then five and five before the union decided to give in on six and five.

"The players are inclined to give up dollars for years, because they know . . . it's best for the players," Hunter said.

A week ago it looked like the union and owners were hurtling toward a lockout. Unable to reach an agreement, both sides began posturing. Stern said that if the union didn't agree to a deal before July 1, it would be a "mistake of epic proportions." Hunter responded by saying that if both sides decided on a lockout, it would be the "death knell" of the NBA.

The big break came in a 14-hour meeting in New York last Friday, where both sides reached the outline of a deal. Players' union President Michael Curry said the owners and union knew the stakes were huge and couldn't afford a fight.

"Having gone through a lockout before, I knew that the negotiations weren't near where they were in '98," Curry said. "Both sides knew that getting a deal would be much better than getting some of the things you want, coming out of a lockout."

Stern said it came down to a simple fear: "We both got encouraged to sit down and try to avoid the apocalypse that we were each describing."

Lee reported from San Antonio.