A federal judge granted a preliminary injunction against the Trump administration’s latest move to widely restrict asylum for migrants coming to the southern border, according to court documents.

U.S. District Judge Jon Tigar in California issued the preliminary injunction blocking the new asylum restrictions Wednesday afternoon, just hours after a hearing where he grilled a government attorney over the new sweeping change to asylum policy.

The policy, announced by the Trump administration last week, would broadly end asylum eligibility for migrants who pass through another country on their journey to the United States' southern border with Mexico, but do not attempt to seek the protection in those other countries first.

Tigar noted in his order that Congress has already established a "safe third country" rule but that requires an agreement with that other country, as well as determinations about safety and other matters. The U.S. has such an agreement with Canada, but Mexico has said there is no such agreement and Guatemala's high court blocked a possible agreement, the Associated Press has reported.

"Congress has ensured that the United States will remove an asylum applicant to a third country only if that country would be safe for the applicant and the country provides equivalent asylum protections to those offered here. The Rule provides none of these protections," Tigar wrote.

"An injunction would vindicate the public's interest — which our existing immigration laws clearly articulate — in ensuring that we do not deliver aliens into the hands of their persecutors," Tigar wrote elsewhere in the order.

During a hearing Wednesday morning in San Francisco, Department of Justice lawyer Scott Stewart defended the new interim rule as “lawful” and “appropriately issued.” The government has said the rule is needed to “address the urgent, ongoing crisis” at the border.

The American Civil Liberties Union, the Southern Poverty Law Center and the Center for Constitutional Rights have challenged the policy, saying it violates domestic and international law and the right of migrants to seek asylum in the U.S.

“The court recognized, as it did with the first asylum ban, that the Trump administration was attempting an unlawful end run around asylum protections enacted by Congress,” ACLU attorney Lee Gelernt said after the ruling.

During the hearing, Tigar questioned the ability of countries like Mexico and Guatemala to adequately deal with and process asylum-seekers.

"There’s some pretty tough stuff in there," said Tigar.

Tigar added that in Mexico, while “applications are up dramatically” there was no indication that Mexico would be able to handle the volume of asylum-seekers and process all of their claims.

The judge added that neither in the rule nor in the government’s administrative record was he able to find a "scintilla of evidence" about the adequacy of the asylum system in Guatemala.

Tigar said during the hearing he expected a quick appeal by whichever side was not successful in his ruling.

He has previously issued an injunction in another case involving asylum restrictions by President Donald Trump.

In Wednesday's ruling granting a preliminary injunction, Tigar acknowledged that strains on the immigration system have only increased since the fall of 2018.

"But shortcutting the law, or weakening the boundary between Congress and the Executive, are not the solutions to these problems," Tigar wrote.

He wrote elsewhere in the order that that the public "has a substantial interest in ensuring that the statutes enacted by its representatives are not imperiled by executive fiat."

In the past, federal judges have blocked other attempts by the administration to change the asylum policy, most notably Tigar’s previous order, issued late last year, blocking the president's effort to deny the protection to anyone who did not enter the U.S. through a legal port of entry.

"This is just another volley in the ongoing war against asylum-seekers," Melissa Crow, senior supervising attorney at the SPLC’s Immigrant Justice Project, said Wednesday before the order was decided.

Earlier Wednesday, a federal judge in Washington, D.C., denied a motion for a temporary restraining order in a separate legal challenge on the rule. That lawsuit was filed July 16 in Washington D.C. by the Refugee and Immigrant Center for Education and Legal Services and the Capital Area Immigrants' Rights Coalition

In denying the request for the temporary restraining order, U.S. District Judge Timothy J. Kelly said the groups challenging the rule did not show that their work would be irreparably harmed if the policy moved forward, according to The Associated Press.

“We are disappointed in the court’s decision today, but we will continue to fight to ensure that this harmful rule does not unjustly impact children and adults who apply for asylum, as well as immigration legal service providers’ ability to help asylum-seekers,” Claudia Cubas, CAIR Coalition’s litigation director, said in a statement Wednesday.

Jonathan Ryan, executive director of RAICES, said in a statement, “We are deeply concerned that if this rule goes into effect, migrants seeking refuge from extremely dangerous places will have few options to protect themselves and their families.”

In addition to the claims of irreparable harm, that suit said the administration’s rule violated migrants’ due process rights, anti-trafficking protections and was unlawful under federal statutes.

When Stewart brought up Kelly’s decision at the hearing in San Francisco, Tigar said that ruling was not binding on his own decision.

“My ruling is not binding on him just as his ruling is not binding on me,” he said, adding if there were any conflicts in their decisions a higher court could resolve them.

The language of the new interim rule on asylum at the southern border includes very limited exceptions, including for migrants who were denied asylum in at least one other country before the U.S., migrants who can show they meet the definition of a "victim of a severe form of trafficking in persons,” or migrants who came to the U.S. through countries which are not parties to three international treaties regarding asylum and refugees.

The rule does not prevent migrants from seeking two different forms of protection, withholding of removal or relief under the Convention against Torture. Those forms of relief face a much higher standard of proof than the standard in credible fear interviews, an initial step in the asylum process, and are more limited forms of relief than asylum.

“Today’s ruling is an important victory for incredibly vulnerable individuals and families from besieged Central American countries seeking refuge in our country," Crow, of the SPLC, said after Tigar's ruling.