A federal judge temporarily blocked President Donald Trump's plan to deny most asylum claims at the U.S.-Mexico border, dealing a major blow to the administration's latest attempt to deter migration to the U.S.

The nationwide injunction by the Northern District of California judge, who had been appointed by President Barack Obama, came on Wednesday, just hours after a Trump-appointed judge in Washington, D.C., said the policy would be allowed, at least temporarily.

The dueling rulings all but guarantee the question over restricting asylum claims would be appealed and possibly wind up before the Supreme Court.

"Today’s ruling is an important victory for incredibly vulnerable individuals and families from besieged Central American countries seeking refuge in our country," said Melissa Crow, a senior supervising attorney with the Southern Poverty Law Center. "We will continue to fight this draconian policy as well as the myriad of others through which the Trump administration continues to wage war on asylum-seekers and our nation’s asylum system."

Earlier this week, the Trump administration had announced it would begin denying asylum claims and immediately deporting people who had passed through a third country en route to the U.S., unless that person had already sought asylum in that other country. The purpose of the plan was to force the vast majority of asylum seekers arriving from Central America to apply for asylum in Mexico without crossing into the United States.

White House Press Secretary Stephanie Grisham slammed the California ruling as the act of a lone judge and a "few activist groups with no legal standing."

"The tyranny of a dysfunctional system that permits plaintiffs to forum shop in order to find a single district judge who will purport to dictate immigration policy to the entire Nation – even in the face of a contrary ruling by another Federal court – must come to an end," she said in a statement.

The Southern Poverty Law Center had challenged the policy in court along with the American Civil Liberties Union and Center for Constitutional Rights.

"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 Lee Gelernt, an attorney with the ACLU.

Ken Cuccinelli, who oversees legal immigration under Trump as acting director of the U.S. Citizenship and Immigration Services, had celebrated just hours earlier on Twitter after the Washington, D.C., judge allowed the policy to stand.

DHS's new Asylum Rule stands in D.C. Court ruling! A major victory for @realDonaldTrump's efforts to stop the crisis at our Southern border. 👍https://t.co/HDxrfNryqu — USCIS Acting Director Ken Cuccinelli (@USCISCuccinelli) July 24, 2019

His office did not respond to a request for comment on the latest ruling, which came late Wednesday.

Trump has tried -- unsuccessfully for the most part so far -- to prevent the tens of thousands of families with children arriving at the border each month in a bid to claim asylum. He has focused most of his attention on trying to force Congress into paying for a border wall, at one point shutting down the government over the matter before finally relenting. He also has called for increased deportations, although his agency has limited resources and bed space to detain undocumented migrants.

Matthew Albence, the acting head of U.S. Immigration and Customs Enforcement, was expected to testify before Congress on Thursday. In prepared testimony, Albence will ask Congress for additional resources to deport more of the 10.5 million undocumented immigrants living in the U.S.

"If we only enforce our immigration laws at the border and fail to provide adequate resources to ensure those who have entered illegally proceed through the immigration process and, if ordered removed, are actually removed, the entire system will break down," he states, according to his prepared remarks. "Such failure will continue to serve as a magnet for additional aliens to illegally enter the country."

DHS's new Asylum Rule stands in D.C. Court ruling! A major victory for @realDonaldTrump's efforts to stop the crisis at our Southern border. 👍https://t.co/HDxrfNryqu

His office did not respond to a request for comment on the latest ruling, which came late Wednesday.

Trump has tried -- unsuccessfully for the most part so far -- to prevent the tens of thousands of families with children arriving at the border each month in a bid to claim asylum. He has focused most of his attention on trying to force Congress into paying for a border wall, at one point shutting down the government over the matter before finally relenting. He also has called for increased deportations, although his agency has limited resources and bed space to detain undocumented migrants.

Matthew Albence, the acting head of U.S. Immigration and Customs Enforcement, was expected to testify before Congress on Thursday. In prepared testimony, Albence will ask Congress for additional resources to deport more of the 10.5 million undocumented immigrants living in the U.S.

"If we only enforce our immigration laws at the border and fail to provide adequate resources to ensure those who have entered illegally proceed through the immigration process and, if ordered removed, are actually removed, the entire system will break down," he states, according to his prepared remarks. "Such failure will continue to serve as a magnet for additional aliens to illegally enter the country."