A federal appeals court has rejected an effort by sex workers and their advocates to have California's laws that criminalize prostitution declared unconstitutional.

A three-judge panel of the U.S. Court of Appeals for the Ninth Circuit on Wednesday affirmed a trial judge's earlier ruling that said laws prohibiting prostitution were in the public interest and did not unconstitutionally interfere with free speech guarantees, the right to free association or the right to conduct business.

“[W]e conclude that laws invalidating prostitution may be justified by rational basis review,” wrote Judge Jane Restani.

Restani is a U.S. Court of International Trade judge who was sitting by designation. She was joined by Ninth Circuit Judges Consuelo Callahan and Carlos Bea in affirming an earlier ruling by U.S. District Judge Jeffrey White of the Northern District of California.

The lawsuit was filed by the Erotic Service Provider Legal Education and Research Project on behalf of three prostitutes in the San Francisco area. The lead defendant was San Francisco District Attorney George Gascon, although the lawsuit was defended by the California Attorney General's Office.

Marin, Alameda and Sonoma counties also were named as defendants.

The Erotic Service Provider Legal Education and Research Project is an advocacy group for sex workers, based in San Francisco. It describes its mission as empowering the erotic community and advancing sexual privacy rights.

Its attorney, H. Louis Sirkin, of Cincinnati's Santen & Hughes, said only that he was disappointed with the ruling and would ask for a rehearing before the full circuit.

A spokespersons for Attorney General Xavier Becerra issued a brief statement. “We are letting the opinion speak for itself,” Becerra's press office said.

The lawsuit was filed in March 2015. White dismissed the lawsuit a year later, and the plaintiffs appealed.

In their lawsuit, the plaintiffs said that laws criminalizing prostitution violate the First and Fourteenth Amendment rights to freedom of association, the Fourteenth Amendment guarantee of a right to earn a living and First Amendment free speech rights.

Wednesday's Ninth Circuit opinion noted the U.S. Supreme Court's 2003 ruling in Lawrence v. Texas, in which a 6-3 majority struck down anti-sodomy laws in Texas and in 13 other states. But that ruling, Restani said, never fully defined protected intimate contact.

“[O]ne thing Lawrence does not make explicit is that the Lawrence case 'does not involve … prostitution,'” Restani said.

Restani also referred to the circuit court's 1988 ruling in IDK v. Clark County. There, the court said the relationship between a prostitute and a client is not protected by the due process clause of the Fourteenth Amendment.

“While ESP maintains that criminalization of prostitution makes erotic service providers more vulnerable to crimes, and does not significantly alter the spread of diseases, such assertions to not undermine the 'rational speculation' found sufficient to validate the legislation,” Restani said.

“ESP's claims may yet convince the California Legislature to change its mind. But the court cannot change its mind for them,” Restani said.