SACRAMENTO, Calif. (AP) — Adora Perez spent four years in prison for the death of her stillborn child after prosecutors in California’s Central Valley charged her with murder for using drugs during her pregnancy.

Tuesday, California lawmakers advanced a bill that would let people like Perez sue prosecutors for charging them with those crimes — crimes that the state’s Attorney General has said do not exist under state law.

READ MORE: 'Their Choice And Not Ours': Elk Grove Family Speaks Out After Sudden Turn In Teen's Murder Case

California already has laws preventing the prosecution of mothers who deliver stillbirths because of drug use or other pregnancy-related reasons. But that hasn’t stopped some prosecutors from bringing murder charges against some women in high-profile cases.

State law generally protects prosecutors from liability. In California, victims wrongly accused of crimes can apply to the Victim Compensation Board, where they are eligible for $140 for each day in prison and pre-trial custody.

But the bill moving through the California Legislature would let pregnant people sue prosecutors for erroneously charging them with a crime related to a pregnancy loss. District Attorneys offices could get hit with a $25,000 fine and other damages as determined by a judge or a jury — a provision aimed at convincing prosecutors not to bring these charges in the first place.

“We want to make sure to stop these prosecutions before they even start,” said Farah Diaz-Tello, senior counsel for If/When/How, a reproductive justice advocacy group that is co-sponsoring the legislation.

In Perez’s case, she agreed to plead no contest — the same effect as a guilty plea but without admitting guilt — to a manslaughter charge in 2018 to avoid a much longer prison sentence for murder. A judge sentenced her to 11 years in prison.

In March — four years after her plea — another judge overturned Perez’s sentence, ruling “there is no crime in California of manslaughter of a fetus.” The judge sent the case back to the Kings County District Attorney’s office, which is now pursuing a murder charge. Perez is out of jail on bail while the case is pending. A preliminary hearing is scheduled for next month.

A representative from the Kings County District Attorney’s office did not respond to a phone message or an email message seeking comment.

State governments across the country are racing to pass new abortion laws ahead of an expected U.S. Supreme Court ruling this summer that could overturn Roe v. Wade, the landmark case that prevented states from outlawing abortions. California and other Democrat-led states are trying to increase access or strengthen protections around abortions while Republican-led states are passing bans and restrictions.

READ MORE: Dirtbike Rider Ejected From Seat After Losing Control

As of 2018, at least 38 states had laws declaring the victim of a crime can include a fetus, according to the American College of Obstetricians and Gynecologists. But most of those laws prevent charging pregnant women with crimes. California could become the second state, after Illinois, that lets pregnant people sue prosecutors for erroneous charges related to pregnancy loss, according to Diaz-Tello, the lawyer for If/When/How.

The bill — which cleared the Assembly Health Committee on Tuesday — would also clarify that people cannot be liable for civil or criminal penalties “based on their actions or omissions” with respect to a “perinatal death due to a pregnancy loss.” Perinatal is not defined in the bill, but it usually includes up to seven days after birth, according to a legislative analysis of the proposal.

That has stoked fears from anti-abortion advocates that the bill would let people kill children in the first seven days after birth and face no consequences — including women suffering from post-partum depression.

“The intention is people use this as another form to terminate their pregnancy, even after the baby has been alive,” said Jennifer Sterling, one of the hundreds of people who traveled to the California Capitol on Tuesday to speak against the bill during a public hearing.

But the bill would not allow that. Dr. Selina Sandoval, an obstetrician/gynecologist, testified the bill would only apply to deaths that occurred because of something that happened during the pregnancy.

“This bill would not prevent police from investigating fetal deaths that occurred as a result of a crime committed against a pregnant person, or from investigating infant deaths that occurred as a result of an act or omission that took place after delivery,” said Assemblymember Buffy Wicks, a Democrat from Oakland who authored the bill.

Wicks testified she is the mother of two children who has also had a miscarriage.

“In California today, we have women who are being prosecuted for having miscarriages, and that is not OK,” Wicks said. “We have to send a message to the rest of this country that you cannot be criminalized for pregnancy-related losses.”

MORE NEWS: Sacramento Woman Ignores 'Do Not Cross' Sign, Hit And Killed By Car

Copyright 2022 The Associated Press.