Purvi Patel is taken into custody on March 30, 2015, at the St. Joseph County Courthouse in South Bend, Ind., after being sentenced to 20 years in prison for feticide and neglect of a dependent. (Robert Franklin/South Bend Tribune via AP)

An Indiana appeals court has overturned the conviction of Purvi Patel, who was accused of neglect and feticide after she took abortion drugs to end her pregnancy.

The court ruled on Friday that the Indiana legislature didn’t intend for the feticide law “to be used to prosecute women for their own abortions,” the Associated Press reported. The court said the law “intended for any criminal liability to be imposed on medical personnel, not women who perform their own abortions.”

Patel was previously sentenced to 20 years in prison in 2015, two years after her self-induced abortion at her family’s home.

Although the appeals court overturned the feticide ruling, it upheld a lower-level felony neglect of a dependent conviction, according to the AP.

Many Indiana residents feel embarrassed and misunderstood

The case alarmed pro-choice advocates, who worried that feticide laws meant to protect women from dangerous illegal abortions could be used to criminally punish women who end their pregnancies. Women’s advocacy groups told The Washington Post that Patel’s case marked the first time a state feticide law was used against a woman because of an alleged self-induced abortion.

“Prosecutors in Indiana are using this very sad situation to establish that intentional abortions as well as unintentional pregnancy losses should be punished as crimes,” Lynn Paltrow, executive director for NAPW, told the Guardian in August, 2014. “… No woman should be arrested for the outcome of her pregnancy.”

Advocates also worried that it would make pregnant women more reluctant to seek medical attention.

Indiana woman jailed for “feticide.” It’s never happened before.

Patel was arrested after she sought treatment at a local hospital for profuse bleeding after delivering a 1½-pound boy in a bathroom and putting his body in a trash bin at a Super Target near her family’s restaurant, according to court records. The records show she bought abortion-inducing drugs from an online pharmacy in Hong Kong.

Patel, who was 32 at the time, used the drugs because she feared her family would discover she had been impregnated by a married man, according to documents. Patel lived with her parents and grandparents in Granger, a city just northeast of South Bend along the Michigan border.

Though Patel said her baby died in a miscarriage, prosecutors argued that she had attempted to induce her own abortion, basing their argument on text messages found on Patel’s phone in which she told a friend she was taking abortion drugs bought online. But a toxicologist was unable to find evidence of drugs in Patel’s or her baby’s body.

Read more: 

‘The ice cream is as bitter and cold as the owner’: After tirade, Internet turns on woman’s business

Black cop blasts white officers: ‘They are looking for a reason to kill a black man’