MEXICO CITY — The Trump administration has won the support of Mexico’s incoming government for a plan to remake U.S. border policy by requiringasylum seekers to wait in Mexico while their claims move through U.S. courts, according to Mexican officials and senior members of President-elect Andrés Manuel López Obrador’s transition team.

President Trump briefly described the arrangement in a pair of tweets Saturday evening. “Migrants at the Southern Border will not be allowed into the United States until their claims are individually approved in court,” Trump wrote. “No ‘Releasing’ into the U.S....All will stay in Mexico.”

The president then issued a threat. “If for any reason it becomes necessary, we will CLOSE our Southern Border. There is no way that the United States will, after decades of abuse, put up with this costly and dangerous situation anymore!” Trump wrote.

Earlier in the day, White House spokesman Hogan Gidley said in a statement that “President Trump has developed a strong relationship with the incoming Lopez Obrador Administration, and we look forward to working with them on a wide range of issues.”

The agreement would break with long-standing asylum rules and place a formidable barrier in the path of Central American migrants attempting to reach the United States and escape poverty and violence. By reaching the accord, the Trump administration has also overcome Mexico’s historic reticence to deepen cooperation with the United States on an issue widely seen here as America’s problem.

According tooutlines of the plan, known as Remain in Mexico, asylum applicants at the border will have to stay in Mexico while their cases are processed, potentially ending the system, which Trump decries as “catch and release,” that has generally allowed those seeking refuge to wait on safer U.S. soil.

“For now, we have agreed to this policy of Remain in Mexico,” said Olga Sánchez Cordero, Mexico’s incoming interior minister, the top domestic policy official for López Obrador, who takes office Dec. 1. In an interview with The Washington Post, she called it a “short-term solution.”

“The medium- and long-term solution is that people don’t migrate,” Sánchez Cordero said. “Mexico has open arms and everything, but imagine one caravan after another after another. That would also be a problem for us.”

On Saturday, following publication of The Washington Post story and criticism of the incoming government for acceding to pressure from Trump, Sánchez Cordero and other members of the incoming government denied that an agreement had been reached and said talks with the United States were ongoing.

While no formal agreement has been signed, and U.S. officials caution that many details muststill be discussed, the incoming Mexican government is amenable to the concept of turning their country into a waiting room for America’s asylum system.

While they remain anxious that the deal could fall apart, U.S. officials view this as a potential breakthrough that could deter migration and the formation of additional caravans that originate in Central America and cross through Mexico to reach the United States. They have quietly engaged in sensitive talks with senior Mexican officials, attempting to offer a diplomatic counterbalance to Trump’s threats and ultimatums.

Alarmed by Trump’s deployment of U.S. military forces to California, Arizona and Texas, and his threats to close busy border crossings, Mexican officials were further determined to take action after migrants traveling as part of a caravan forced their way onto Mexican soil last month, pushing past police blockades at the border with Guatemala.

The prospect of keeping thousands of Central American asylum seekers for months or years in drug cartel-dominated Mexican border states — some of the most violent in the country — has troubled human rights activists and others who worry that such a plan could put migrants at risk and undermine their lawful right to apply for asylum.

“We have not seen a specific proposal, but any policy that would leave individuals stranded in Mexico would inevitably put people in danger,” said Lee Gelernt, an ACLU attorney whose team has won several legal victories against the Trump administration’s immigration initiatives in recent months.

“The Administration ought to concentrate on providing a fair and lawful asylum process in the U.S. rather than inventing more and more ways to try to short-circuit it,” Gelernt said.

The measures could also trigger legal challenges, though Gelernt said it was too early to comment on potential litigation.

The deal took shape last week in Houston during a meeting between Marcelo Ebrard, Mexico’s incoming foreign minister, and top U.S. officials such as Secretary of State Mike Pompeo and Homeland Security Secretary Kirstjen Nielsen, according to U.S. and Mexican officials.

Nielsen has been fighting to keep her job since the midterms, and while Trump has told aides he plans to replace her, the president praised her this past week for “trying.”

Dozens of U.S. asylum officers have been sent to San Diego, where they will begin implementing the procedures in coming days or weeks, according to Department of Homeland Security officials. Under the procedures, asylum seekers arriving at the border will be given an initial screening interview to determine whether they face imminent danger by staying in Mexico.

U.S. officials describing the system on the condition of anonymity said they will be able to process at least twice as many asylum claims as they do now because they would not be limited by detention space constraints at U.S. ports of entry. The San Ysidro port of entry in the San Diego area accepts about 60 to 100 asylum claims per day.

Just over the border, nearly 5,000 Central Americans have arrived in Tijuana this month as part of caravan groups, and several thousand others are en route to the city, where a baseball field has been turned into a swelling tent camp. The city’s mayor declared a “humanitarian crisis” Friday and said the city’s taxpayers would not foot the bill for the migrants’ care.

A group of business leaders in the city said they have thousands of job openings at the city’s assembly plants, or maquiladoras, inviting Central American migrants to work in the factories. Though wages there are a small fraction of U.S. pay, Mexican officials said the work offer was one reason they believe the Remain in Mexico plan will succeed. Across the country, there are 100,000 jobs available to Central American asylum seekers, officials said.

“We want them to be included in society, that they integrate into society, that they accept the offer of employment that we are giving them,” Sánchez Cordero said. “That they feel taken care of by Mexico in this very vulnerable situation.”

Two senior members of López Obrador’s transition team said the accord would formalize what is already occurring. By admitting so few people into the asylum process, the United States isalready using Mexico as an antechamber.

U.S. immigration statistics show roughly 80 percent of Central Americans pass a perfunctory “credible fear” interview after reaching the United States, but fewer than 10 percent are ultimately granted asylum by a judge. The backlog of cases in U.S. immigration courts has ballooned past 750,000, giving many asylum seekers who do not qualify a chance to remain in the country for several years while waiting to see a judge.

This gap, Department of Homeland Security officials say, amounts to a “loophole” that has invited a flood of spurious asylum claims, giving applicants a way to live and work in the United States for years.

Last month, the number of people taken into U.S. custody along the Mexican border or who attempted to enter without authorization topped 60,000, the highest of Trump's presidency.

For months, U.S. officials soughtan accord with Mexico that would obligate asylum seekers to wait south of the border or render those who pass through the country ineligible for humanitarian protections in the United States. They have viewed such an accord as the key step to stopping the sharp increase in asylum claims, which have quadrupled since 2014.

One version of the plan, known as a “Safe Third” agreement, was discussed extensively with the government of President Enrique Peña Nieto. It would have barred Central Americans from applying for asylum in the United States, on the grounds that they would no longer face persecution after arriving in Mexico.But ­López Obrador’s landslide July 1 victory sunk those plans, and senior members of his transition team say a Safe Third is a non-starter.

Mexican officials consider the Remain in Mexico plan more palatable. It would not lock them into a formal, long-term agreement. Several Mexican officials privately acknowledge that the country’s border states are not, in fact, safe. U.S. State Department travel warnings also urge American visitors to avoid several Mexican border states.

U.S. officials involved in the talks said Mexico has not asked for financial assistance to implement the procedures, which could result in significant costs if asylum seekers are made to wait for months or years. They described the deal as a collaboration, and senior officials from both governments insisted it was not imposed upon Mexico.

American and Mexican officials said they hoped the accord would pave the way to a broader regional cooperation aimed at stimulating job creation in Central America.

“Our engagement with Mexico is, first and foremost, based on mutual respect and on a commitment to work together to find creative solutions to our shared challenges,” said Kimberly Breier, a senior State Department official with purview of Mexico and Latin America who participated in the talks.

“As neighbors and friends, the United States and Mexico are committed to strengthening cooperation to advance the security and economic well-being of the citizens of both nations based on shared interests and respect for each country’s sovereignty and the rule of law,” Breier said in a statement.

A fixture on Mexico’s left for decades, López Obrador won on populist promises to fight corruption and help the poor. Many U.S. officials assumed he would bring a more confrontational approach toward Trump and the United States. During the campaign, he was generally restrained in his criticism of Trump, repeatedly expressing a desire for a positive relationship.

At times he offered harsh assessments, though: He referred to Trump as a “neo-fascist” last year as he was gearing up for his campaign, and he later said the Mexican government had been doing Washington’s “dirty work” by catching Central Americans.

Since his victory in July, López Obrador and Trump have traded compliments. Sánchez Cordero said the transition team’s interactions with the Trump administration have been “surprisingly cordial.”

“Trump has been very friendly, very courteous, very cordial with President López Obrador,” said Sánchez Cordero. “It’s been a very smooth relationship.”

U.S. asylum officers and other immigration officials who began receiving guidance this past week on the implementation of Remain in Mexico were told the procedures could take effect imminently, but senior officials from both governments saykey details remain unresolved.

U.S. officials want to roll out the program at the San Diego border crossing to deal with the caravans that have become a source of frustration for Trump,but they envision it could be expanded to another five to seven crossings along the U.S.-Mexico border. Senior U.S. officials said they want more assurances on how Mexico intends to keep asylum seekers safe and to ensure they don’t get deported back to Central America before their asylum claims are resolved.

After an initial fear screening at the port of entry, the asylum seeker would wait until his or her scheduled court appearance before an immigration judge. Then the asylum seeker would be escorted to a federal courthouse by U.S. officers, but would potentially have to return to Mexico again if the judge did not reach an immediate determination on the claim.

Under the rules, an applicant whose asylum claim is denied would not be allowed to return to Mexico. Instead, the person would remain in U.S. custody and face immediate deportation to his or her home country.