Women’s rights advocates haven’t had many victories in the past couple of years, but now they are celebrating two—one in  Arkansas, and the other in the Midwest. Last month, the United States District Court for the Western District of Wisconsin made an announcement in the case of Tammy Loertscher, who had been jailed for 18 days after admitting to having used drugs early in her pregnancy. The district court denied the state’s motion to have the suit thrown out, so the case is now heading to trial.

Loertscher has received national attention as one of very few to pushback successfully against a slew of punitive laws, many enacted in the past several years, that have targeted pregnant women. She never guessed she’d become a symbol of resistance. Growing up in a small, working-class industrial town in northern Wisconsin, Loertscher dreamed of being an astronaut. But until recently, she’d barely even made it out of the state, where she found work in the health-care system. In Wisconsin, she fell in love with a local boy, Dondi Ellner, who had been around the world as a musician—and even knew how to cook. They moved in together and shared his niece’s house. Things were good for a while, and then not so much.

On August 1, 2014, Loertscher, then 29, soft-spoken and bespectacled, hit a low point. She had been feeling depressed, she says, by “the small bubble of small-town life” and what she describes as the bleakness of the nursing home where she was working. She quit, and without income or health insurance, Loertscher couldn’t afford her hyperthyroid medication so her thyroid spiraled out of control, causing exhaustion and depression. She had self-medicated sporadically with marijuana and amphetamines; saying the drugs helped her get out of bed in the morning. But in July, suspecting she might be pregnant, she said she went cold turkey off everything. Soon, she found her depression spiraling again, and she and Ellner began fighting. Within a few weeks, she was feeling suicidal.

She went to the county’s social services office to ask for help, and received a referral to the Mayo Clinic in nearby Eau Claire. There she gave an accounting of her medical history, including the drug use before she knew she was pregnant. This is what experts in addiction and public health say she should have done, but Loertscher now regrets having played by the rules. “I figured if I was honest with them, maybe there was something to do to prevent harm to the baby,” Loertscher says. “I didn’t think being honest would put me in a horrible place.”

One doctor was reassuring, but another, she says, told her any damage she’d done was done, and irreparable. She waited a full day for the ultrasound results: “I had to beg them to let me know if it was okay.” Eventually, the tests showed that the baby was 14 weeks along and healthy. She burst into tears, she says, from relief.

The baby wasn’t planned. Loertscher didn’t think it was possible for her to get pregnant because of her thyroid problems, but she and Ellner, 43, had always said that if they were able to conceive, they’d be happy. “Tammy is very pure at heart,” Ellner told me. “She’s a girl next door—down to earth, a sweet and loving person.” And that summer he—for the first time in his life, he says—had “this strange feeling like, I’m going to get you pregnant. And two months later, SHAZAM.”

At the Mayo Clinic, Loertscher breathed a sigh of relief. The new thyroid medication had kicked in. She felt ready to go home. And she felt confident that she would be able to continue staying away from drugs during the pregnancy as she had, she says, for the weeks prior. But that feeling was short-lived. Because of her drug use (at the hospital, there was an unconfirmed positive on methamphetamine, plus her own admission to having used it in the past), she was not allowed to leave. According to court records, a representative of the hospital did what is done in much of the country under those circumstances: He or she called social services and reported her. In some states drug use during pregnancy is not only cause for child-welfare involvement, but also potentially for criminal felony prosecution (the laws in Tennessee and Alabama are particularly tough), or, in the case of Wisconsin, for intervention and detention at any point during pregnancy.

In 1997, a unique law—referred to as the “cocaine mom” law—passed the Wisconsin legislature amid a climate of fear that so-called “crack babies” would overwhelm the system. It’s now generally believed that the hysteria was misplaced. “Not only was that really stigmatizing for the children who were born that way,” said Sara Ainsworth, the director of legal advocacy for National Advocates for Pregnant Women, “it wasn’t even true.” Studies have shown that children born with cocaine in their systems have not shown long-term cognitive or behavioral problems. But the law’s goal was to give prosecutors wide latitude when faced with a woman who they believe “habitually lacks self-control” or constitutes a “substantial risk” to her fetus.

While cocaine isn’t seen as a major issue the way it was 20 years ago, opiates and amphetamines are. In this part of Wisconsin, one recent study found 13 percent of pregnant patients in one practice used illegal drugs during their pregnancies. Hospitals around the country have reported an increase in babies showing Neonatal Abstinence Syndrome—withdrawal symptoms—that can require effective, but sometimes costly and lengthy, treatment in the NICU.

The local child welfare department appointed a lawyer for Loertscher’s fetus, even though Loertscher did not have a lawyer herself. “I was so upset,” Loertscher says, “And I had no idea how things worked. I’d never been in trouble before.” (Aside from a bounced check charge from several years ago, Loertscher has no criminal record.) Loertscher was brought into a room at the hospital and told the judge was on the phone. She told the judge she didn’t want to speak without a lawyer present and left the room. The judge finished the hearing without her and ordered her to treatment.

“I don’t understand why this is happening,” Loertscher recalls saying at the time. “Since I had the inkling that I was pregnant, I didn’t do anything … They said I was terrible. And I wasn’t.” Remembering that period of time brought her to tears. Loertscher believed going to treatment would require her to admit that she was an addict, which she insisted she wasn’t. And so she was found in contempt of court and incarcerated.

During her 18 days in jail, Loertscher says she received no prenatal care and, when she refused to submit to urine tests, was put in solitary confinement, with nothing but a roll of toilet paper. She says a guard told her, “The drugs you did, [the baby] is going to come out deformed.”

In recent years, there’s been a rise in prosecutions of women on the grounds that their unborn children must be protected. Women who are found to have used drugs during pregnancy—even when they want the baby, and even in some cases when the drugs in question are prescribed by their doctors, like methadone—they may be subject to child welfare involvement, jail time, or both, depending on the laws in their state and the prosecutors in their county.

Loertscher is one of the few to fight back. In December 2014, supported by various groups, she filed a lawsuit in U.S. District Court in Madison, Wisconsin, against the state attorney general and the Department of Children and Families, seeking to overturn the law as unconstitutional. “This law removes every constitutional right that you can think of that is associated with being a person in the United States,” said Ainsworth, one of the lawyers backing her. “Tammy lost her liberty, her privacy, her medical decision making. She was in fact encouraged by this law to consider having an abortion that she didn’t want. Every right that we associate with being a person was taken from her. All in the name of protecting a 14-week-old fetus.”

The suit raises legal and moral questions likely to be debated as the case moves forward: Is it fair to punish pregnant drug users far more harshly than non-pregnant ones, or does that effectively make it a crime to be pregnant? What is the best way to protect a baby or fetus if the mother is engaging in behaviors considered to be risky, like drinking alcohol or using illegal drugs? Is it appropriate for law enforcement to intervene when mothers are not having a healthy pregnancy—and if so, where is the line between acceptable and unacceptable risk? Are these fetal-protection laws effectively anti-abortion laws? (Wisconsin Right to Life supported the original “cocaine mom” legislation and includes it on a list of “Right-to-Life Laws.”)

The stakes of Loertscher’s lawsuit are high. Though there are no specific statistics on the number of “cocaine mom” cases, if the single-year numbers provided in a report from Wisconsin’s DCF are representative, then since 2005, as many as 3,000 pregnant women may have been prosecuted for “unborn child abuse” in Wisconsin. Among them is Alicia Beltran, who in 2013 was jailed and sentenced to two months in an inpatient treatment center even though she had weaned herself from Percocet with Suboxone and showed no evidence of enduring drug abuse. In 2005, Rachael Lowe went to a Wisconsin hospital seeking treatment for an OxyContin addiction and wound up behind bars.

“These women are put in jail and get abused. They get the worst care,” says Kathy Hartke, the chair of the Wisconsin section of the American Congress on Obstetricians and Gynecologists, who says pregnant patients of hers have been subject to prosecution. “It is the absolute opposite of what we want. And what will happen the next time they get pregnant? They will not come for care. You can help a woman onto the right path, and many of them are willing to do that, but if you set them up for failure, they’re going to end up in our prisons, and that’s the worst place. That’s just a waste of life. My experience is that when you work with a woman in a nonjudgmental, compassionate way, they will respond, and they want to do the best for their baby.”

Shawna Veley, a 27-year-old stay-at-home mother with a 13-month-old baby girl in Wisconsin, says she’s glad Loertscher is suing. She was in treatment for heroin addiction and on Suboxone when she gave birth to her daughter, and says nurses at the hospital threatened her with arrest. “They treated me like I was trashy,” Veley said. “It made me feel really little. I could definitely feel people looking at me like, ‘She’s an addict, and so she’s going to be a crappy mom, and so we should treat her bad.’ My daughter motivates me to stay away from the people I used to be around. I want to be the best I can be for her. I never want to disappoint her. I don’t want her to be left without me. Just because someone’s a recovering addict doesn’t mean they can’t be a great mom.”

In January of this year, Loertscher and Ellner’s baby was born healthy, at seven pounds. They named him Harmonious. Soon after, they left for Hawaii, to move in with Ellner’s sister, who is in the military, and now they are living in a friend’s basement in Allentown, Pennsylvania, where Ellner has found work at a restaurant. He’s also playing music again—performing in a rock cover band, and putting together an original group. Loertscher says she’s enjoying being a stay-at-home mom to Harmonious, who she brags is already, at about nine months, mostly potty-trained and pulling himself up on the furniture, then taking a couple of steps. “He’s so good—everywhere we go, the grocery store, restaurants—nobody can believe it,” she said.

Loertscher told me she’s “so excited” by the ruling, and heartened by the fact that the child-abuse charges against her have been dropped, so she has a clean slate. She said while they were in limbo a few months ago that she told one of her lawyers she wanted to keep the federal case going: “I said to her I didn’t want this to happen to anyone else. It was so awful. She said the way to make them realize it’s wrong is you take them to as big a court as we can and sue them. In the legal system, that’s how you show someone they’re wrong.”