A federal judge in California on Wednesday blocked the Trump administration from imposing restrictions on individuals seeking asylum in the United States, just hours after a judge in Washington had decided to let the rule stand while lawsuits play out in court.

The rule, published in the Federal Register last week, required people seeking asylum to apply first in one of the countries they cross on their way to the U.S. -- with certain exceptions. It targeted tens of thousands of Central Americans who have crossed Mexico each month trying to enter the U.S.

The rule was met quickly with a legal challenge from advocacy groups, who moved for a temporary restraining order blocking the rule. After a hearing in Washington, D.C. federal court, District Judge Timothy J. Kelly denied the motion. But hours later, U.S. District Judge Jon Tigar in San Francisco, an Obama appointee, blocked the enforcement of the rule. His ruling took effect immediately.

LINDSEY GRAHAM CLAIMS BORDER FRAUD SO PREVALENT 'A TERRORIST COULD EASILY GET IN'

"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," said ACLU attorney Lee Gelernt in a statement.

Melissa Crow, a senior supervising attorney with the Southern Poverty Law Center called Tigar's block, "an important victory for incredibly vulnerable individuals and families from besieged Central American countries seeking refuge in our country."

The White House had earlier called the decision to uphold the Trump administration's rule "a victory for Americans concerned about the crisis at our southern border," adding, "Tens of thousands of migrants making opportunistic asylum claims have not only exacerbated the crisis at our southern border but also have harmed genuine asylum seekers, who are forced to wait years for relief because our system is clogged with meritless claims."

Kelly, who was appointed to the bench by President Trump said the immigrant advocate groups who filed the lawsuit did not show that their work would be irreparably harmed if the policy moved forward.

With certain exceptions, the rule requires individuals to apply for and be denied asylum in another country in order to apply in the U.S. That means that migrants from Central American nations who travel through Mexico – who make up a significant portion of recent asylum seekers – will not be eligible for asylum in America unless they previously applied for asylum in Mexico or any other country they traversed and were turned down.

The new rule’s exceptions include certain cases of human trafficking.

The rule is meant to crack down on asylum seekers coming to the U.S. more for economic reasons than to escape persecution in their home countries. Administration officials say this could help close the gap between the initial asylum screening that most people pass and the final decision on asylum that most people do not win. The goal in part is to allow quicker determinations in these cases.

TRUMP ADMINISTRATION AIMS TO EXPAND FAST-TRACK DEPORTATIONS ACROSS US, LEGAL FIGHT EXPECTED

The policy follows the Trump administration's Migrant Protection Protocols, commonly referred to as the "remain in Mexico" policy. Under that policy, asylum seekers were often told to go back to Mexico to await hearings, rather than be allowed to remain in the U.S.

Democrats railed against that policy, with 2020 hopeful Beto O'Rourke calling it "inhumane."

A reduction in asylum seekers would ease the burden on federal agencies currently overwhelmed by the volume of individuals seeking entry into the U.S.

CLICK HERE TO GET THE FOX NEWS APP

Detention facilities have been notoriously stretched for resources, resulting in outcries against the government. The criticism has particularly been strong when it comes to the conditions in which migrant children have been kept.

Fox News' Judson Berger, Matt Leach and The Associated Press contributed to this report.