A federal appeals court rejected on Monday arguments by adult film production company Vivid Entertainment to strike down the Los Angeles County condom law and instead upheld its key elements.

In a 30-page ruling, the 9th Circuit Court of Appeals in San Francisco concluded that free expression rights of Vivid, one of the largest producers of adult films in the San Fernando Valley, and performers Kayden Kross and Logan Pierce were not violated by the mandatory condom law.

The law, known as Measure B and approved by voters in November 2012, “was narrowly tailored to achieve the substantial governmental interest of reducing the rate of sexually transmitted infections, and left open adequate alternative means of expression,” the court ruled.

The 9th Circuit, however, let stand a lower federal court ruling that some sections of the condom law were unconstitutional and cannot be enforced. Those sections covered charges by county health department for permits and inspection of adult film sets to make sure the law was being followed.

Measure B was a ballot initiative backed by the AIDS Healthcare Foundation in Hollywood. The result of its passage has been a sharp decline in adult filming in the county and speculation within the industry that filming would move out of state to get away from the regulation.

Vivid, Kross and Pierce filed their lawsuit in January 2013 challenging the new law and asking for a court order to prevent enforcement.

While not disagreeing that government has an interest in stopping the spread of sexually transmitted diseases, Vivid and the two performers said that the condom law was not narrow enough to achieve that goal. As part of their argument, the plaintiffs noted the Free Speech Coalition, the adult industry’s trade organization in Canoga Park, established a testing protocol and database for adult performers.

The court determined that the condom law didn’t need to be the most effective way for government to achieve its interest or show that the law cannot be circumvented.

“Rather, it suffices if the regulation helps to achieve the substantial government interest effectively,” the court ruling concluded.

Foundation President Michael Weinstein and several other representatives of the organization were allowed to intervene in the case when it was heard in Los Angeles federal court. Weinstein said Monday that the decision affirms the rights of adult performers to have the same workplace protections as other workers.

“Should Vivid Entertainment and other porn producers decide to appeal the decision and bring their misguided case before the U.S. Supreme Court, we welcome the challenge for the courts to rule once again in favor of worker safety and show how the porn industry cares more about their bottom line than their workers,” Weinstein said in a prepared statement.

Free Speech Coalition Chief Executive Diane Duke said that while the decision allows for mandatory condom use it doesn’t mean they should be.

“Rather than protect adult performers, a condom mandate pushes a legal industry underground where workers are less safe,” Duke said in a statement. “This is terrible policy that has been defeated in other legislative venues.”