TRENTON, N.J., FEB. 3 -- The New Jersey Supreme Court today invalidated the $10,000 surrogacy contract between William Stern and Mary Beth Whitehead-Gould, ruling that "this is the sale of a child or, at the very least, the sale of a mother's right to her child."

The unanimous court awarded custody of 22-month-old Melissa Stern, known throughout the bitter court battle as Baby M, to Stern and his wife, Elizabeth. It directed the lower court judge to determine when and how Whitehead-Gould may visit the child she bore by artificial insemination with Stern's sperm.

Under the ruling, such contracts are legal as long as they involve no fee and allow a mother to change her mind about relinquishing all rights to her baby. Any resulting disputes are to be resolved according to state adoption and custody law -- in the best interests of the child.

The Sterns and Whitehead-Gould indicated today that they would not appeal.

"I did not begin this as a public crusade, but I am gratified to see that surrogacy has been discredited," Whitehead-Gould said tearfully at a news conference this afternoon. "There can never be a court-appointed termination of my love for my daughter," whom she named Sara.

The Sterns' attorney, Gary Skoloff, said at a separate news conference that they will not appeal but will ask the lower-court judge to deny Whitehead-Gould visitation rights until the child is much older.

Last March, Bergen County Superior Court Judge Harvey N. Sorkow upheld the contract, stripped Whitehead-Gould of all claims to Baby M and allowed Elizabeth Stern to adopt her immediately after his ruling. The state Supreme Court allowed Whitehead-Gould to visit for two hours each week while it heard her appeal.

Skoloff said Elizabeth Stern, although elated by the custody decision, is upset that today's ruling nullifies her legal status as adoptive mother. It gives a new judge, to be apppointed by the Superior Court chief judge, 90 days to devise a visitation schedule for Whitehead-Gould.

Whitehead-Gould's lawyer, Harold Cassidy, hailed the decision as a "death knell for commercial surrogacy" and a "triumph for human decency." David Levy, president of the National Council for Children's Rights, called it "an excellent decision. It does not uphold the contract but does affirm the child's right of access to both natural parents."

Surrogacy advocates said the ruling misrepresents the fees received by surrogate mothers, arguing that they are paid for their time and not for their babies. It does not apply in other states, but Skoloff said other state courts may follow its lead, relying on adoption and custody law, unless state legislatures deal with the issue.

According to the National Coalition Against Surrogacy, 12 surrogacy disputes are pending in courts nationwide.

"If the legislature decides to address surrogacy, consideration of this case will highlight many of its potential harms," the New Jersey Supreme Court said today. "In addition to the inevitable confrontation with the ethical and moral issues involved, there is the question of the wisdom and effectiveness of regulating a matter so private, yet of such public interest."

But it said the legislature was bound only by "constitutional constraints."

Baby M, born March 27, 1986, was minutes old when Whitehead-Gould changed her mind about the contract and several weeks old when she fled with the baby to her parents' home in Florida.

The Sterns, who had relinquished the child for a brief visit with Whitehead-Gould, obtained a custody order in New Jersey, and mother and child were brought back to the state. Meanwhile, the $10,000 fee was held in escrow.

Whitehead-Gould was then 29, married to trash collector Richard Whitehead and the mother of two other children. She has since divorced Whitehead and married New Jersey stockbroker Dean Gould. They are expecting their first child in June.

In his decision last year, Judge Sorkow said Whitehead-Gould's rocky marriage to Whitehead, who had a history of alcoholism, and her rash behavior in running away with the child made her the less fit parent. But he said adoption law did not apply to surrogacy and based his custody decision on the fact that there was no existing law against the contract she knowingly signed with Stern.

The seven state Supreme Court justices overruled him, holding that the contract violated three specific state adoption statutes.

The first prohibits the payment of money in adoptions except to an approved agency. The second forbids taking away a natural parent's rights without proof that the parent had abandoned or neglected the child. The third allows a natural parent to change his or her mind about giving up a child for adoption.

The opinion, written by Chief Justice Robert N. Wilentz, said the contract amounted to "baby-selling," which "potentially results in exploitation of all parties involved" and is "degrading to women."

"This is the sale of a child, or at the very least, the sale of a mother's right to her child, with the only mitigating factor being that one of the purchasers is the father. Almost every evil that prompted the prohibition of payment . . . in connection with adoption exists here," Wilentz said.

He said the contract fails to consider the best interests of the child, the fitness of the contracting parents, the impact of separation on the natural mother and child, or the factors -- including financial need -- that may lead a woman to bear a child for an infertile couple.

"There are, in a civilized society, some things that money can't buy," Wilentz said.