The Trump administration cannot categorically detain asylum seekers while they pursue their cases, a federal judge in Seattle ruled Tuesday, bringing a temporary halt to a policy announced by Attorney General Bill Barr in April.

U.S. District Judge Marsha Pechman said those who are detained after crossing the border are entitled to bond hearings. Barr's order had instructed immigration judges to no longer offer the bond hearings for illegal immigrants caught crossing the border, although Barr preserved the option for the DOJ to effectively offer exceptions on a case-by-case basis.

Barr's determination did, however, affect even asylum seekers who had shown at an initial screening that they had a so-called "credible fear" of persecution or torture in their home countries, which often poses the most substantial hurdle in the asylum process. Applicants who successfully demonstrate a credible fear, according to federal immigration law, are those who have a "significant" chance of proving eligibility for asylum on that basis at their final asylum adjudications.

The Trump administration's move came in response to a growing humanitarian crisis at the border, as immigration courts that process asylum claims reported a backlog of more than 800,000 cases -- with many asylum applicants staying in the U.S. even after their claims have been denied.

NADLER SAYS BORDER SECURITY OFFICIALS SHOULD BE PROSECUTED FOR 'CHILD ABUSE'

According to a White House fact sheet, only 12 out of 100 migrants who claim asylum will have their claim granted on average, while around half of all migrants who make a "credible fear" claim "and are subsequently placed in removal proceedings do not actually apply for asylum."

The issue has been front-and-center in the 2020 presidential primary. On Tuesday, Cory Booker said that as part of a broader immigration plan, he would create "a presumption of liberty for immigrants by reforming the bond process in immigration court."

Pechman effectively agreed with Booker, saying that migrants who have entered the U.S. and been detained here are entitled to the Fifth Amendment's due-process protections, including "a longstanding prohibition against indefinite civil detention with no opportunity to test its necessity."

Immigrant rights advocates including the American Civil Liberties Union and the Northwest Immigrant Rights Project sued to block the policy, which was due to take effect July 15.

"The court reaffirmed what has been settled for decades: that asylum-seekers who enter this country have a right to be free from arbitrary detention," Matt Adams, legal director of the Northwest Immigrant Rights Project, said in a written statement. "Thousands of asylum-seekers will continue to be able to seek release on bond, as they seek protection from persecution and torture."

WHAT OTHER RESTRICTIONS HAS THE TRUMP ADMIN PROPOSED ON ASYLUM SEEKERS?

For the past 50 years, the government has given asylum-seekers bond hearings before immigration judges where they can argue that they should be released because they are not flight risks and pose no threat to the public, the groups told the court. The process gives the asylum-seekers an opportunity to reunite with relatives in the U.S. and to find lawyers to handle their asylum claims, making them more likely to succeed.

The Trump administration's new policy would end that practice, keeping between 15,000 and 40,000 immigrants in custody for six months or more without requiring the government to show that their detentions are justified, in violation of their due process rights, the groups argued. Typically, close to half of asylum-seekers who are granted bond hearings are released from custody.

"The Court finds that Plaintiffs have established a constitutionally-protected interest in their liberty, a right to due process which includes a hearing before a neutral decisionmaker to assess the necessity of their detention, and a likelihood of success on the merits of that issue," the judge wrote.

In her order, Pechman said the government must provide a bond hearing to any immigrant who has demonstrated that they have a credible fear of persecution or torture if returned to their home country within seven days of a request. The asylum-seekers must be released if not granted a hearing within that time frame, she said.

Pechman also said the burden must be on the government at such hearings to show that keeping asylum-seekers in custody is necessary because they pose a flight risk or a danger to the public.

“The court forcefully rejected the Trump administration’s bid to arbitrarily jail asylum-seekers without a hearing," Michael Tan, senior staff attorney, ACLU’s Immigrants’ Rights Project, said in a statement. "Try as it may, the administration cannot circumvent the Constitution in its effort to deter and punish asylum-seekers applying for protection.”

CLICK HERE FOR THE FOX NEWS APP

The Trump administration last year rolled back an Obama-era expansion of potential asylum justifications, which extended protections to those alleging domestic abuse or gang-related attacks back home. White House officials said at the time that those categories were prone to abuse and expanded asylum law beyond its original intent.

In a memorandum issued in April, Trump gave his deputies 90 days to propose regulations so that all asylum applications are adjudicated within 180 days, except for those representing exceptional circumstances. The White House also moved to restrict asylum applicants from receiving work permits and proposed a fee for asylum applicants.

Fox News' Andrew O'Reilly and The Associated Press contributed to this report.