The Kansas Supreme Court yesterday struck down a state law that penalized same-sex statutory rapes by 18-year-olds much more harshly than heterosexual cases, ruling that the law unconstitutionally discriminated against gays.

In a 6 to 0 opinion, the court said its decision was required by the U.S. Supreme Court's 2003 ruling in Lawrence v. Texas, a landmark victory for gay rights that abolished all state laws criminalizing sodomy between consenting adults.

Yesterday's ruling was the first time after several attempts that gay rights advocates had managed to translate their Lawrence victory into a favorable ruling on another issue in the lower courts. In 2003, the Massachusetts Supreme Judicial Court established same-sex marriage, based on the state's constitution, not Lawrence.

Under the logic of the Kansas ruling, "not only this law but a lot of other laws that treat gay people badly would fall," said James D. Esseks, a lawyer for the American Civil Liberties Union's Gay and Lesbian Rights Project.

Esseks acknowledged, however, that only one other state, Texas, has a statutory rape law like Kansas's. There are no court challenges pending in Texas. The Kansas ruling would not apply in another state.

Esseks argued the case on behalf of Matthew Limon, who will be released after serving five years of a 17-year sentence under the Kansas law. His sentence would have been 15 months at most if he had been convicted of a heterosexual act.

Kansas Attorney General Phill Kline (R) said the state probably would not appeal to the U.S. Supreme Court, noting that, as a state legislator, he had voted against the disputed provision. In a prepared statement, he said that "it appears the Court has limited its holding," preserving the state's option to criminalize conduct like Limon's even if the sentence must be the same.

Still, at a time when the role of the courts in social issues is at the heart of debate over President Bush's nomination of Harriet Miers to the Supreme Court, the ruling was likely to raise conservative concerns.

"The court acted like a legislature when it attempted to rewrite the statute," said Mathew Staver, president and general counsel of Liberty Counsel, a conservative litigation organization that supported Kansas in the case.

In 2000, when Limon was 18 and a student at a state residential school for mentally disabled youth, he was convicted of having oral sex with a fellow student who was one month shy of his 15th birthday.

There was no claim the sex was coerced. Kansas, like many other states, criminalizes voluntary sex between adults and minors. But in 1999 it enacted a "Romeo and Juliet" law that set a lower penalty for a statutory rape involving an 18-year-old having sex with a 14- or 15-year-old. The lighter punishment applied only to "members of the opposite sex."

Limon appealed to the U.S. Supreme Court, claiming unconstitutional discrimination. The court held the case until it had decided Lawrence, then sent the issue back to the Kansas courts with instructions to review it in light of the new precedent.

Kansas's lower appeals court once again upheld the law, finding it constitutional because it was connected to the state's interests in protecting the normal sexual development of children and preventing sexually transmitted diseases.

But the Kansas Supreme Court said that, under Lawrence, Kansas may not use its laws to express "moral disapproval" of homosexuality -- denying any "rational basis" for the Kansas law's distinction between homosexual and heterosexual acts.

"Neither the court of appeals nor the state cites any scientific research or other evidence justifying the position that homosexual sexual activity is more harmful to minors than adults," the court said.