Homeland Security Secretary Nielsen says asylum seekers will be forced to wait in Mexico Trump administration predicts policy will result in drop in asylum cases.

The U.S. has reached a deal with the Mexican government to force asylum seekers at its southern border to remain in Mexico while they wait to bring their case before an American immigration judge, a process that could take several months or even years, Homeland Security Secretary Kirstjen Nielsen announced at a congressional hearing on Thursday.

The new policy, effective immediately, is the latest attempt by the Trump administration to curb what it insists are loopholes in the immigration system. Like many of its immigration policies, the plan was likely to face pushback in court.

Nielsen's announcement before a House Judiciary Committee came as President Donald Trump remained locked in a bitter dispute with lawmakers over whether to shut down the government if he doesn't get the money he wants to buy a border wall.

"We have a huge problem with asylum fraud," Nielsen told the House panel. "We need to work together to combat that."

Nielsen's testimony encountered immediate pushback from congressional Democrats who called the plan a misguided attempt to demonize immigrants.

"Is it as (though) you can't see the realities of modern immigration or the contributions of anyone who came from countries other than Norway or other parts of Europe," said Rep. Luis Gutiérrez, D-Illinois. "It's as though you and others in the administration are blind."

At issue is how the United States decides who should be granted asylum, a right granted to migrants by U.S. and international law. According to the Homeland Security Department, border officials have seen a surge in migrants from El Salvador, Guatemala and Honduras and that the vast majority are granted entrance into the United States after passing a "credible fear" interview.

DHS said in a statement Thursday that in nearly half of these cases in 2018, the person later failed to appear at a hearing or file an asylum claim, indicating that the person likely opted to remain illegally inside the U.S. As a result, DHS says, only 9 percent of people from those three countries are ultimately granted asylum.

John Cohen, a former acting under secretary at the Homeland Security Department and an ABC News contributor, noted that the law does allow for the federal government, through the attorney general, to deport someone to a "safe third country" pending an asylum claim, if there is bilateral agreement.

But, the law requires that the person's "life or freedom" not be threatened, and that the person claiming asylum still have "full and fair" access to the U.S. immigration system. That means it's likely the U.S. will have to devote resources to either bring people into the United States to see an immigration judge, or set up U.S. courts in Mexico -- a highly unusual situation that presents legal complications, Cohen said.

"It's highly probable this will be challenged in court," Cohen said. "It'll be up to the courts to determine whether processing someone in Mexico is consistent with the law or not."

Administration officials said they expect a dramatic drop in asylum claims if people are not allowed to enter the U.S. and are instead forced to wait in Mexico. Several Republicans on the House committee said they supported the move.

Secretary of State Mike Pompeo called the plan "historic" and said that the Mexican government has promised to give the migrants humanitarian visas to stay on Mexican soil, as well as the ability to apply for work.

"We think that they (migrants seeking asylum) will now see that they can’t disappear inside the United States, and so they will remain in their home countries," Pompeo told Fox News host Laura Ingraham.

Mexico has previously refused to accept the return of migrants who aren't Mexican citizens. But earlier this week, the U.S. signed a joint declaration with Mexico promising to invest $5.8 billion in southern Mexico and the three countries where most of the migrants were coming from -- El Salvador, Guatemala and Honduras. The administration also promised a U.S.-Mexico business summit next year and a cabinet-level meeting in January.

The Associated Press reported Thursday that Mexico's Foreign Relations Department called the latest agreement to allow U.S. asylum seekers to remain in Mexico was a temporary, humanitarian measure.

Trump has been under political pressure from his supporters to take a hard line with immigration. While illegal crossings fell during his first year in office, they have returned to previous levels.

The president's other executive actions aimed at curbing those crossings at the U.S.-Mexico border have faced setbacks in court. On Wednesday, a federal judge blocked a separate policy that restricts asylum claims of migrants fleeing domestic and gang-related violence. Another federal judge in California issued a nationwide preliminary injunction against a Trump administration rule that made anyone who crosses the southern border outside a port of entry ineligible for asylum.

Trump has expressed frustration in recent days that he hasn't been able to fulfill his promise to build a border wall.

"When I begrudgingly signed the Omnibus Bill, I was promised the Wall and Border Security by leadership," Trump tweeted. "Would be done by end of year (NOW). It didn’t happen! We foolishly fight for Border Security for other countries - but not for our beloved U.S.A. Not good!"

ABC News reporters Conor Finnegan and Luke Barr contributed to this report.