INDIANAPOLIS -- An Indiana woman whose feticide conviction for a self-induced abortion was overturned in July walked out of prison Thursday, a day after a judge resentenced her to less time than she had already served and ordered her immediate release.

Purvi Patel, 35, was with relatives when she left the Indiana Women's Prison in Indianapolis about 10 a.m., said Indiana Department of Correction spokesman Doug Garrison.

Her attorney, Lawrence Marshall, said Patel is "very, very joyful that this day has come," but that she now needs privacy so that she can focus on rebuilding her life.

"For right now, she needs to recover from what is obviously a traumatic several years," said Marshall, a Stanford University law professor. "She has to take her life and try to make something meaningful out of all the wreckage that got her here."

Patel was convicted in 2015 of killing her premature infant by taking abortion-inducing drugs and sentenced to 20 years in prison. She appealed her feticide and child neglect convictions and the Indiana Court of Appeals vacated both convictions in July, finding that the state's feticide law wasn't meant to be used to prosecute women for their own abortions.

But the appeals court found that Patel should be resentenced on a lower-level child neglect charge that carries a maximum three-year sentence.

The state's attorney general decided not to appeal the ruling, and on Wednesday, a St. Joseph County judge resentenced Patel to 18 months of prison time on the child neglect charge.

Patel was arrested in July 2013 after she sought treatment at a hospital for profuse bleeding.

According to prosecutors, she took abortion-inducing drugs she bought on the Internet and gave birth to a very premature baby boy at her family's home in Granger, a community northeast of South Bend. Patel was at least 25 weeks into her pregnancy, just beyond the threshold of viability, and the infant took at least one breath before dying, they alleged. She put the child's body in a trash bin behind her family's restaurant.

Patel's attorneys, who said she thought she was only 10 to 12 weeks into her pregnancy, argued that the evidence prosecutors used did not support her convictions and that the laws prosecutors used didn't apply to her alleged actions in the premature delivery.

But attorneys for the state argued that the feticide law could apply to a pregnant woman and not just "third-party actors."

The appeals court disagreed, saying that since the law was passed in 1979 it had only been used to prosecute those who attacked pregnant women.

Women's advocacy groups argued that Patel's arrest marked the first time in Indiana that the state's feticide law was used against a woman because of an alleged self-induced abortion.