LOS ANGELES (AP) — A Los Angeles County law requiring adult film performers to wear condoms is constitutional, a federal judge has ruled.

The decision is a setback to porn producers who filed a lawsuit to block the implementation of the Safer Sex in the Adult Film Industry Act, or Measure B, which was approved by voters last November. It was sponsored by five individuals affiliated with the nonprofit AIDS Healthcare Foundation.

In the ruling Friday, U.S. District Judge Dean Pregerson wrote that supporters presented sufficient evidence of the health risks the measure seeks to reduce.

The law "will in fact alleviate those harms in a direct and material way," Pregerson wrote.

The decision was cheered by AHF president Michael Weinstein, one of the five individuals affiliated with the foundation who were the official proponents of Measure B. After county officials declined to defend the measure, the foundation was granted "intervener" status to defend it.

The porn industry later tried to have the group removed, but the motion was denied.

"Today's ruling ... is just a tremendous, tremendous victory, one that will go a long way to safeguard the health and safety of those adult performers working in the industry," Weinstein said Friday.

Vivid Entertainment and Califa Productions and porn performers Kayden Kross and Logan Pierce sued the county in January to prevent the implementation of the new law.

Vivid Co-Chairman Steven Hirsch expressed disappointment in the ruling.

"We continue to believe this unfunded mandate infringes upon our freedom of speech, and we will continue our fight by filing an immediate appeal to this portion of the court's ruling," Hirsch said in a statement Saturday.

Since the law's adoption, Los Angeles County health officials have confirmed they are investigating at least one alleged violation.