The state can punish illegal underage sex more harshly when it involves homosexual acts, even if the only goal is promoting traditional sexual roles, an official told the Kansas Supreme Court (search) on Tuesday.

Deputy Attorney General Jared Maag said legislators have such broad latitude in setting policy that "any conceivable, rational basis" would justify the different treatment.

Maag argued in favor of upholding a sentence of more than 17 years in prison for Matthew R. Limon, convicted of criminal sodomy for having sex at age 18 with a 14-year-old boy in 2000.

Had the victim been a girl, Limon could have been sentenced to one year and three months in prison under a 1999 law. His attorneys argued the different treatment represents discrimination against gays and lesbians — and is unconstitutional.

But Maag said the different treatment is acceptable if legislators can argue there's a rational reason — protecting public health, protecting children or promoting traditional values.

"If you admit there's a conceivable basis that's at least arguable, then that is enough to uphold the statute as constitutional," he said.

James Esseks, an American Civil Liberties Union (search) attorney representing Limon, said the state has "fanciful justifications" for the harsher sentence.

Esseks said the state is basing its law on "private prejudice," which is constitutionally unacceptable.

"Homosexuality is not a mental disorder," he said. "There is nothing inherently harmful about it."

After the hearing, Esseks said any reason for the different treatment must be justified with "real-world facts."

"These connections are so tenuous as to be arbitrary and unconstitutional," Esseks told the court.

Limon's case has received national attention. National health groups and the National Association of Social workers (search) filed legal arguments supporting his position. A conservative Florida legal foundation, the Liberty Counsel, helped prepare written arguments from 25 legislators in support of the law.

Kansas law makes any sexual activity involving a person under 16 illegal, regardless of the context. Also, Limon had two previous, similar offenses on his record.

Limon's attorneys note that had his victim been female, the state's 1999 "Romeo and Juliet" law would have applied. It establishes lesser penalties for illegal sex when the partners' ages are within four years and one partner is under 19 — and specifically applies only when the partners are of the opposite sex.

The Kansas Court of Appeals rejected Limon's appeal in 2002. Last year, the U.S. Supreme Court struck down a Texas law criminalizing gay sex and returned Limon's case to the state courts.

But in a 2-1 decision in January, the Kansas Court of Appeals noted that the U.S. Supreme Court case involved consenting adults and sided with the state again. Limon then appealed the Kansas Supreme Court, which could rule as early as Oct. 15.

Justice Lawton Nuss suggested legislators left little evidence of their thinking when they wrote the law. Justices Carol Beier, Robert Gernon and Marla Luckert repeatedly questioned Maag about possible justifications.

For example, Beier said, if the goal is to prevent the spread of AIDS, then the law is "a poor fit," because the harsher sentence applies to acts involving two females — which are the least likely to transmit the disease.

Maag said he could not argue with her point, but he also said, "The means don't have to perfectly fit the ends."