ICE has detained 525 pregnant women since last October, which advocates call part of a troubling trend under Trump.

Carolina Ramirez had spent three weeks locked up in a prison-like detention center north of Houston when she discovered she was pregnant. It had taken the 23-year-old two months to travel from El Salvador to Texas, a difficult journey during which her smuggler raped her multiple times. Now, she was carrying his child. Ramirez desperately wanted out. Her mental health was deteriorating, and she wasn’t ready for an impending court date. But it would be six months before she was finally released.

Documents obtained by the Observer show Ramirez, who requested a pseudonym, repeatedly asked Immigration and Customs Enforcement (ICE) for parole on medical grounds so she could stay with family in Missouri as her case advanced. Federal policy encourages release of pregnant women and her attorney, Raul Tovar, was sure officials would let her go. Instead, immigration agents kept Ramirez locked up in the Joe Corley Detention Center, a for-profit facility that’s been the site of a hunger strike and rape allegations. Advocates say Ramirez’s story is part of a troubling trend of prolonged detention of pregnant women in ICE custody.

In September, seven organizations filed a complaint with the U.S. Department of Homeland Security, accusing the agency of “failure to abide by its own policy against detaining pregnant women.” The complaint includes stories from 10 pregnant women who were locked up in recent months, including Ramirez. The women reported bad food, nausea, vomiting, depression and inability to get specialized care. In the last year, at least five women have miscarried in detention, according to the Huffington Post.

Ramirez stopped eating, began sleeping excessively and was diagnosed with major depressive disorder, according to medical records.

Multiple Obama-era ICE directives, the latest in 2016, prohibit detaining pregnant women absent “extraordinary circumstances” due to their “particular needs and vulnerabilities.” Under that guidance, pregnant women who arrived at the border were typically assigned a court date and released within days. But advocates say these directives are increasingly ignored under Trump.

“Suddenly, starting in July or August, we started to hear of more and more cases [of pregnant women in detention],” said Katharina Obser of the Women’s Refugee Commission, a national organization. And some advocates noted a change as early as last November.

Jennifer Elzea, an ICE spokesperson, wouldn’t confirm whether Obama’s 2016 directive is still in effect, saying release decisions are made based on the “individual facts and circumstances of the case.” Elzea also provided statistics: 525 pregnant women were detained since October of last year, with 33 in detention as of September 13. Elzea said she couldn’t provide complete figures for the previous year and didn’t provide a month-by-month breakdown, making it impossible to identify a trend.

Ramirez spent six months of her pregnancy locked up in the Joe Corley Detention Center, a 1,500-bed facility surrounded by razor-wire fencing on a dead-end road in Conroe. Until two years ago, it was an all-male facility. Owned and operated by the for-profit prison corporation GEO Group, the center holds detainees at three levels of security concern, including men who are violent offenders. (The groups are housed separately according to gender and security level, said Houston ICE spokesperson Gregory Palmore.)

In 2014, more than 180 detainees took part in a hunger strike at the facility over poor food and telephone access, according to an internal ICE review. A Salvadoran man has alleged he was raped twice at the facility in late 2013 and called “stupid” by an ICE official when he reported it. And, in April 2016, the Women’s Refugee Commission toured the facility and criticized conditions in a report released last week.

In that jail-like setting, Ramirez discovered on February 17 that she was pregnant, records show. Ramirez requested to be released by ICE, but the agency said she had to pass an initial screening first. Ramirez failed the interview in late February, but her attorney challenged the results, and two months later, the decision was reversed without explanation. Meanwhile, she stopped eating, began sleeping excessively and was diagnosed with major depressive disorder, according to medical records.

When her attorney asked ICE to release Ramirez again, the government refused for a new reason: Ramirez had entered the country illegally before.

In 2014, Ramirez had come to the U.S. without documentation and was detained in Cameron County. While in detention, according to her parole request, she learned her mother had suddenly died back home, leaving her 12-year-old niece with no one to care for her. Ramirez abandoned her legal case and returned to El Salvador to take care of her niece, who then migrated to Missouri a year later. Ramirez’s father and five siblings all live in Missouri, and being alone in El Salvador left her an easy target for the gangs, said Tovar.

In early May, ICE surprised Tovar by saying they couldn’t release Ramirez because of her previous entry. Again, he disputed the decision, and after another two months, Ramirez was released in July without explanation — when she was more than seven months pregnant.

In total, Ramirez’ detention likely cost U.S. taxpayers about $22,000.

Now, Ramirez is finally with her family in Missouri, and Tovar said they’re working to find her a new lawyer in the area. She’s due to give birth any day now.