SAN FRANCISCO (AP) — A federal appeals court has rejected a lawsuit that aimed to legalize prostitution in California.

The 9th U.S. Circuit Court of Appeals said Wednesday that the relationship between a prostitute and a client is not an intimate association protected by the U.S. Constitution.

READ MORE: Torrance Woman Arrested In Mistaken ID Revenge Murder Of NorCal Rapper

A three-judge panel of the court ruled that California had legitimate reasons for criminalizing prostitution, including discouraging human trafficking and violence against women. The judges upheld a lower-court ruling.

READ MORE: Mother-Daughter Team Win Decade-Long Battle To Bring Sidewalks To San Bernardino County Community Of Muscoy

The decision came in a lawsuit against several California district attorneys and the state’s attorney general. It was filed in 2015 by a San Francisco-based group that includes former sex workers.

An email to an attorney for the group wasn’t immediately returned.

MORE NEWS: UCLA Basketball Star Johnny Juzang Declares For NBA Draft, But Intends To Retain Collegiate Eligibility

(© Copyright 2017 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)