The Indiana Court of Appeals overturned the feticide conviction of a woman found guilty of killing her premature infant by taking abortion-inducing drugs, saying Friday the state's law wasn't intended to be used "to prosecute women for their own abortions."

The ruling comes in the case of Purvi Patel, who was convicted of neglect and feticide last year. However, the court upheld a lower-level felony neglect of a dependent conviction.

She was sentenced to 20 years in prison in 2015, two years after her self-induced abortion at her family's home. Women's advocacy groups have been heavily involved in the case, saying it marks the first time a state feticide law was used against a woman because of an alleged self-induced abortion.

The appeals court ruled that Patel, who is currently in state prison on the neglect and feticide convictions, should be resentenced on the lower-level felony charge, which carries a possible prison term of between six months and three years. Patel's attorneys could not immediately be reached for comment.

Patel, who was 32 at the time, was arrested when 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 behind her family's restaurant. Court records show she bought abortion-inducing drugs from an online pharmacy based in Hong Kong.

She 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.

Attorneys for Indiana argued that Patel was at least 25 weeks into her pregnancy, so her infant was just beyond the threshold of viability and took at least one breath before dying. The attorneys also argued that Indiana's feticide law could apply to pregnant woman, not just "to third-party actors," and that Patel hadn't shown the feticide law constituted an undue burden on the right to an abortion.

The appeals court disagreed, saying the feticide law only had been used since it was enacted in 1979 to prosecute those who attacked pregnant women. The judges also wrote that the wording of state law on illegal abortions shows the Legislature "intended for any criminal liability to be imposed on medical personnel, not women who perform their own abortions."

Patel endangered the child by not seeking medical care, but prosecutors failed to prove that her failure to do so resulted in the boy's death, the court said.

The appeals court heard arguments in the case on May 23. Two dozen women's advocacy groups, as well as Planned Parenthood and the American Civil Liberties Union, filed friend-of-the-court briefs siding with Patel.

At least 38 states have fetal homicide laws, according to the National Conference of State Legislatures. The Patel case was the first time a state feticide law was used against a woman specifically because of "an alleged self-induced abortion," said Jill Adams, executive director of the abortion rights advocacy group Center on Reproductive Rights and Justice.