A federal judge in San Francisco on Wednesday blocked the Trump administration from enforcing a new rule that aimed to bar almost all asylum applications at the U.S.-Mexico border.

U.S. District Judge Jon Tigar in the Northern District of California issued a preliminary injunction blocking the rule, which would require asylum-seekers to first pursue a safe haven in a third country they had traveled through on their way to the United States.

The decision makes inconsequential a ruling by Washington D.C. District Judge Timothy Kelly earlier in the day that declined to block the rule in a different lawsuit brought by immigration advocacy groups, lawyers said.

The Trump administration had been quick to celebrate that decision, saying it would discourage abuse of the asylum process.

Scroll down for video

A federal judge in San Francisco on Wednesday blocked the Trump administration from enforcing a new rule that aimed to bar almost all asylum applications at the U.S.-Mexico border

Central American migrant families recently released from federal detention wait to board a bus at a bus depot in McAllen, Texas on Friday. U.S. District Judge Jon Tigar issued a preliminary injunction Wednesday

A man begs and prays not to be taken away by Mexican immigration authorities as he holds his child, during a raid on a migrant caravan that had earlier crossed the Mexico - Guatemala border, near the city of Metapa in the state of Chiapas, Mexico on June 5. A district judge's Wednesday ruling blocks the Trump administration's order requiring asylum-seekers to first pursue safe haven in countries they traveled through on their way to the U.S.

The Trump administration has sought to curtail the increasing numbers of mostly Central American migrants arriving at the U.S. -Mexico border after fleeing violence and poverty in countries such as Guatemala, Honduras and El Salvador

Following the action by the San Francisco court, the rule will now be suspended pending further proceedings.

'Today's ruling is an important victory for incredibly vulnerable individuals and families,' said Melissa Crow, an attorney from the Southern Poverty Law Center - one of the groups challenging the ban - in a statement.

The Trump administration has sought to curtail the increasing numbers of mostly Central American migrants arriving at the U.S. -Mexico border after fleeing violence and poverty in countries such as Guatemala, Honduras and El Salvador. It has characterized the vast majority of their asylum claims as bogus.

After the White House announced the rule on July 16, the American Civil Liberties Union and other rights groups sued in California on the grounds it violates U.S. law that welcomes those who come to the United States fleeing persecution at home.

The Trump administration has characterized the vast majority of asylum claims as bogus from migrants arriving at the U.S.-Mexico border as bogus

Immigration is shaping up to be a focus of the presidential campaign again in 2020. In the 2016 election, voters rewarded then-candidate Donald Trump's anti-immigrant rhetoric, sending him to the White House after he promised to build a wall on the U.S.-Mexico border and called for a ban on Muslims entering the United States.

In an hour-long hearing in California, U.S. District Judge Jon Tigar (pictured) said he was struck by the dangers faced by people passing through Mexico, which was significant because the Trump administration argued that country was a safe haven

Opponents of the new rule contend the United States cannot force migrants to first apply for asylum in another country, such as Mexico or Guatemala, unless Washington first has a 'safe third country' agreement with that government. Both Mexico and Guatemala have resisted Trump administration efforts to reach such a deal.

In an hour-long hearing in California, Tigar said he was struck by the dangers faced by people passing through Mexico, which was significant because the Trump administration argued that country was a safe haven.

'The administrative record about the dangers faced by persons transiting through Mexico and the inadequacy of the asylum system there ... is stunning,' Tigar said from bench.

Tigar in November struck down a different asylum ban that attempted to block all migrants crossing illegally from asking for refuge in the United States.

The Trump administration has issued a rapid-fire series of anti-immigration edicts recently.

Last week, the administration issued another rule to expedite deportations for immigrants who have crossed illegally within the last two years and are caught anywhere in the United States. The rule eliminated a level of judicial review and expanded a program typically applied only along the southern border with Mexico.

Democrats have blasted the policies as cruel, faulting the Trump administration for warehousing migrants in crowded detention facilities along the border and separating immigrant children from the adults they have traveled with.