A Tennessee woman jailed for more than a year after trying to use a coat hanger to abort her 24-week-old fetus pleaded guilty on Monday to one felony count in exchange for her immediate release from jail.

The woman, Anna Yocca, 32, sought medical care at a hospital after attempting the at-home abortion in September 2015, according to National Advocates for Pregnant Women, an advocacy group that helped with her defense. She was later arrested and was initially charged with attempted murder. Under an agreement reached with prosecutors, she pleaded guilty this week to attempted procurement of a miscarriage and was given credit for time served.

Her case has alarmed abortion-rights advocates concerned by increasingly strict state abortion laws and the election of Donald J. Trump, who has expressed support for overturning Roe v. Wade and once said during the presidential campaign that women who have abortions should be punished.

“This case sends a dangerous message,” said Lynn M. Paltrow, executive director of National Advocates for Pregnant Women, who called the prosecution of Ms. Yocca “a misuse of the existing criminal law system.”