Migrants heading to the southwest border to seek asylum in the US will have to wait in Mexico until their claims are processed under a deal between the two countries announced Thursday that will affect tens of thousands of people each month.

Only about 9 percent of people are actually granted asylum, and the Trump administration insists that too many migrants make up false claims to get in.

“They will not be able to disappear into the United States,” Homeland Security chief Kirstjen Nielsen told the House Judiciary Committee.

“They will have to wait for approval. If they are granted asylum by a US judge, they will be welcomed into America. If they are not, they will be removed to their home countries.”

Discussions on the arrangement have been going on between the two countries for months, well before new leadership took over in Mexico on Dec. 1.

On Thursday, the Mexican foreign ministry said Mexico had agreed to the deal on a temporary basis for humanitarian reasons, and it would affect those “who entered that country or had been apprehended at border entry points, and who have been interviewed by that country’s immigration authorities and who have received a court date to appear before an immigration judge.”

ACLU attorney Lee Gelernt said the plan was illegal.

“This plan cannot be done lawfully and will result in countless people in life-threatening situations,” he said.

The decision comes as the courts have blocked efforts to harden asylum rules.

More than 100,000 immigrants were caught crossing the border in October and November.

Nearly half of them were traveling in family groups that included children, according to statistics from Customs and Border Protection.

While the number of immigrants caught crossing the border illegally has fallen since the 1990s and early 2000s, US authorities have been grappling in recent years with an increase in children traveling alone or with family.

It is not illegal to cross the border without a visa to apply for asylum.

Immigrant advocates say violence in the Central American countries of El Salvador, Guatemala and Honduras is driving people north, and many are coming to seek asylum.

Nearly 100,000 immigrants requested initial asylum screenings during the fiscal year ending in September, according to US Citizenship and Immigration Services. Most of the cases were filed in Texas.

Thousands of migrants have come up from Central America in recent weeks in caravans, which President Trump has claimed without evidence include “Middle Easterners,” terrorists and criminals.

Trump used his national security powers to put in place regulations that denied asylum to anyone caught crossing illegally, but a judge has halted that change as a lawsuit progresses.

Nielsen said in a statement the policy would be done legally.

“This will also allow us to focus more attention on those who are actually fleeing persecution,” she said in a statement.

With Post wires