ANNAPOLIS, OCT. 9 -- Oral sex between consenting heterosexual adults is no longer illegal in Maryland, as long as the activity occurs in private and does not involve prostitution, the state's highest court ruled today in a precedent-setting case.

A divided Court of Appeals, overturning the 1987 conviction of a Montgomery County man, held for the first time that a 74-year-old Maryland statute barring "unnatural and perverted sexual practices" does not apply to "consensual, noncommercial heterosexual activity" performed privately by adults.

The court's 5 to 2 ruling came in the case of Steven Adam Schochet, 28, who is believed to be the only person in Maryland history convicted for a sexual offense under those circumstances. He was sentenced to five years' probation.

The conviction came at the end of a two-day jury trial in which Schochet had stood charged with raping and forcibly sodomizing a Wheaton woman in her apartment. The jury acquitted Schochet of those charges after determining that the woman had been a willing participant.

But the jurors, who had been instructed by the presiding judge that consent was not considered a defense under the perverted sexual practice statute, found Schochet guilty under that law of engaging in fellatio. In addition to barring oral sex, the law prohibits sex with animals.

In appealing the conviction, Schochet's attorney, Joseph P. Suntum, had argued that the law, as applied in his client's case, represented an unconstitutional invasion of privacy. The Supreme Court has recognized a fundamental privacy right in matters such as abortion, but the question of how far that right extends in sexual matters has not been decided by the courts.

The Maryland court majority, in an apparent effort to limit the application of its ruling, decided to sidestep the privacy issue. Instead, it held that in cases where overly broad statutes raise constitutional concerns, the courts must first try to narrow the construction of the law to avoid a serious constitutional challenge.

That was its intent, it said, in holding that certain behaviors should not be covered by the perverted practices law. The court said that the legislature obviously did not intend for the law to apply to heterosexual acts performed in private because no one before Schochet had been convicted; but it had been used in cases involving homosexuals, minors and sexual acts in public places.

Today's ruling was received with some disappointment by the Maryland chapter of the American Civil Liberties Union because it did not extend to homosexuals the same freedom from prosecution as heterosexuals.

"We shouldn't penalize sexual activity between any consenting adults in the privacy of their own home," said Susan Goering, the state ACLU's legal director. "Certainly the court has gone one step in the right direction, but our concern is that this will isolate homosexual activity. It raises questions about whether they enjoy equal protection under the laws in this state."