The Department of Justice issued an order on Tuesday that could keep thousands of asylum-seekers detained while they wait for their cases to be heard in immigration court — a wait that often lasts months or years.

The ruling by Attorney General William Barr is the latest step by the Trump administration designed to discourage asylum-seekers from coming to the U.S. hoping for refuge.

In a written decision that overturns a 2005 policy, Barr directed immigration judges not to release migrants out on bail once their cases have been approved for expedited removal proceedings — a status granted only after an applicant successfully establishes "a credible fear of persecution or torture" in their home country.

"I conclude that such aliens remain ineligible for bond, whether they are arriving at the border or are apprehended in the United States" Barr, who has the authority to overturn prior rulings made by immigration courts, wrote.

Instead, asylum-seekers "must be detained until his removal proceedings conclude." Only those people granted parole by the Department of Homeland Security will be eligible for release, according to Barr's order.

Barr's ruling does not apply to family units or unaccompanied children who generally cannot be held in detention for more than 20 days under the terms of the Flores settlement.

It is unclear how or where the Justice Department expects to detain more people. Last month U.S. Customs and Border Protection said the increase in the number of family units and unaccompanied children has led to a "humanitarian crisis."

"We are currently experiencing a system-wide emergency in our processing and holding facilities," CBP Deputy Commissioner Robert E. Perez said in a statement.

"The humanitarian crisis created by a massive influx of family groups and unaccompanied children in recent months has forced CBP to reallocate resources away from law enforcement, trade and travel missions to process and provide care for those in our custody," Perez added.

The change comes at a time when the backlog of cases in immigration courts is at an all time high. As of February the court's active docket topped 855,000 cases, an increase of more than 300,000 pending cases added to the existing backlog since the end of January 2017, when President Trump took office. Additionally, increasing numbers of Central American migrants from Honduras, Guatemala and El Salvador are fleeing to the U.S. That means Barr's ruling could lead to thousands of asylum-seekers getting stuck in detention for years until their cases can be heard.

While Barr stayed the order for 90 days, immigrant rights advocates have already pledged to challenge the Trump administration's decision in court, Michael Tan, an attorney with the ACLU Immigrants' Rights Project told NPR.

"The Constitution doesn't let the government lock people up without basic due process," he said. "You can't lock people up without giving them the basic hearing before a judge. Where that judge can look at the person and determine if they need to be locked up in the first place."

The Trump administration has consistently argued that in order to solve the escalating immigration crisis, it must end the so-called "catch and release" policy, which allowed border-crossers to live freely in the interior of the country while their cases were adjudicated, a process that could take up to years.

White House officials, including Trump, have insisted that the policy allowed vast numbers of undocumented migrants to disappear into the population and never return for mandatory hearings. But the Justice Department's data contradicts that assertion.

Between 60 to 75 percent of non-detained migrants return to attend immigration court proceedings, according to a report analyzing data from the last five available years.

Other research shows that asylees with legal advocates have even higher rates of court attendance. Studies of a small and short-lived pilot called the Family Case Management Program, concluded 99 percent of participants showed up for court appearances and ICE check-ins. The program, which connected released asylum seekers with case managers, was cancelled by the Trump administration in 2017.

"We know that the asylum seekers coming from Central America right now have real asylum claims, often based on gang violence, gender-based violence, and other forms of persecution that they're highly motivated to pursue in court. They're not trying to run away," Tan said.

Copyright 2019 NPR. To see more, visit https://www.npr.org.