California lawmakers have passed legislation to reduce the penalty for those who knowingly or intentionally expose others to HIV without their knowledge, rolling back a law that mostly affected sex workers.

The bill, SB 239, which was approved by the Democrat-controlled state legislature in September and signed into law by Governor Jerry Brown (D) on Friday, will lower the charges for these acts from a felony to a misdemeanor when the law goes into effect in 2018. The act of knowingly donating HIV-infected blood, also a felony now, will be decriminalized.

The statutes that the new laws revise date back to the late 1980s, when AIDS had emerged as a public health crisis in cities such as San Francisco, Los Angeles and New York. Fear and misinformation about the disease’s potential to spread ran high as the authorities struggled to get a handle on the new epidemic and a spate of legislation about HIV exposure cropped up across the country.

Supporters of the reform push in California, which included a broad coalition of public health, LGBT, civil liberties and HIV groups in the state, described the laws as outdated and ineffective, pointing to statistics that showed that the vast majority of convictions were related to sex workers, who are required to undergo testing for HIV after being convicted of crimes such as solicitation.