WASHINGTON — U.S. officials jailed approximately 2,100 pregnant women for immigration violations in 2018, including hundreds who were held for weeks or months, a 52% increase since President Donald Trump took office, according to a Government Accountability Office report.

The spike in pregnant detainees came after federal officials quietly terminated an Obama administration order to release most expectant mothers because of health concerns.

Advocates for immigrants had pushed the Obama administration to sharply curtail the practice of detaining pregnant women ahead of the 2016 elections, citing insufficient health care and nutrition in federal detention centers and contract jails and the increased risk of miscarriage.

But shortly after the policy went into effect, Trump declared that nobody in the United States illegally is immune to detention and deportation.

The increase in detained pregnant women comes amid myriad policy efforts to put pressure on migrants, with the ultimate goal of deterring people from making the trip to the U.S. southern border. The administration also has tried to restrict underage migrants’ access to abortion services, and advocates for immigrants say officials have expelled pregnant adults to dangerous cities in Mexico to await their asylum hearings.

Most pregnant women taken into custody last year had no prior criminal record, according to the report released Thursday. Most were apprehended by U.S. Customs and Border Protection at or near the southern border, a sign that many were among the thousands of Central American families seeking asylum.

The GAO said the majority of pregnant detainees were held for 15 days or less.

But a breakdown shows that the Trump administration has held more pregnant women for longer periods than previous administrations. U.S. Immigration and Customs Enforcement detained 92 pregnant women for longer than two weeks in 2016, but last year officials held 615 pregnant women longer than that, some for several months.

Jim Crumpacker, the Homeland Security official who wrote an official government response included in the GAO report, said ICE prioritizes detaining and deporting migrants with criminal convictions, and that the agency treats pregnant women and other vulnerable groups with “respect and compassion.” He wrote that ICE considers whether to detain migrants on a case-by-case basis and has released “certain” immigrants, including pregnant women, on humanitarian grounds.

While past administrations have detained pregnant women, ICE issued a memo to its field offices in late 2016 saying pregnant women “generally” should be released from detention and that agents should pay attention to expectant mothers’ “particular needs and vulnerabilities.”

The number of pregnant detainees declined from 1,380 women in calendar year 2016 to 1,160 women in 2017.

But in December 2017, then ICE acting director Thomas Homan — who enforced the policies under both administrations — issued a new directive that officials said “ended the presumption of release for all pregnant detainees.”

During the next year, the number of detained pregnant women rose to 2,098.

ICE officials said after the policy shift that they would not necessarily detain all pregnant women, just those whose detention was necessary to complete their immigration proceedings. Others could be held if they posed a flight risk or a danger to the community. All detainees receive health services, including prenatal testing and care, according to agency policy. ICE does not generally detain women who are in their third trimester of pregnancy.

Lawyers for pregnant women say it is unfair to force women to remain in jail, fighting nausea and other pregnancy symptoms, while pleading their asylum cases.

The Women’s Refugee Commission and other advocacy groups filed a complaint with the Department of Homeland Security’s inspector general and the Civil Rights and Civil Liberties Office in 2017 citing inadequate medical care and reports of women who had suffered infections, stress and, in some instances, miscarriages in detention.

The GAO report examined ICE enforcement from 2015 through 2018, and said arrests and deportations rose overall, including increases in the number of migrants who are elderly, transgender and disabled.