U.S. and Mexican officials are discussing the outlines of a deal that would dramatically increase Mexico’s immigration enforcement efforts and give the United States far more latitude to deport Central Americans seeking asylum, according to a U.S. official and a Mexican official who cautioned that the accord is not final and that President Trump might not accept it.

Faced with Trump’s threat to impose steadily rising tariffs on goods imported from Mexico beginning Monday, Mexican officials have pledged to deploy up to 6,000 national guard troops to the area of the country’s border with Guatemala, a show of force they say will immediately reduce the number of Central Americans heading north toward the U.S. border.

The plan, a sweeping overhaul of asylum rules across the region, would require Central American migrants to seek refuge in the first country they enter after leaving their homeland, the two officials said. For Guatemalans, that would be Mexico. For migrants from Honduras and El Salvador, that would be Guatemala, whose government held talks last week with acting Homeland Security secretary Kevin McAleenan.

Any migrants who made it to the U.S. border generally would be deported to the appropriate third country. And any migrants who express a fear of death or torture in their home country would be subjected to a tougher screening standard by U.S. asylum officers more likely to result in rejection.

Mexico has repeatedly said it would not accept what is known as a “Safe Third Country” agreement with the United States requiring it to take in all U.S.-bound asylum seekers. The United States has such a pact with Canada; it requires asylum seekers to apply for refuge in whichever country they first arrive, since both countries are considered safe.

On Thursday, the Mexican official said, the Mexican government indicated it is willing to make asylum changes for the sake of a coordinated regional approach to stem the flow of Central American migrants now flooding into the United States. But Mexican negotiators also made clear that they will withdraw the offer if Trump makes good on his threat to impose tariffs, telling their U.S. counterparts that the economic damage would undermine Mexico’s ability to pay for tougher immigration enforcement.

The Mexican and U.S. officials described the accord’s framework on the condition of anonymity, citing the sensitivity of the international negotiations, but they expressed optimism that the deal was attainable. Officials from both countries said they did not know whether the terms would assuage Trump and remove the tariff threat; Trump plans to charge a 5 percent tariff on Mexican goods entering the United States unless Mexico can show it will take steps to reduce the flow of migrants to the U.S. border.

The asylum modifications are likely to face challenges in U.S. courts, but legal efforts have thus far failed to stop the Trump administration from sending thousands of Central Americans to Mexico to await their asylum hearings outside U.S. territory.

“Any change to the asylum system that does not provide the safeguards required by domestic and international laws will not survive a legal challenge,” said Lee Gelernt, an attorney with the American Civil Liberties Union.

Word of the emerging deal comes amid escalating warnings of the tariffs’ potential toll. Approximately 406,000 U.S. jobs would be eliminated if the president proceeded with the measures, according to the Perryman Group, an economic consultancy in Waco, Tex.

Implementing the levies will be impossible by “June 10 or even before the increase planned for July 1,” the Pacific Coast Council of Customs Brokers and Freight Forwarders Associations warned in a letter to administration officials, saying it felt “grave concern, even alarm” at the prospect.

Under existing trade rules, the vast majority of U.S.-Mexico trade is duty-free. A sudden shift to tariffs on “all” Mexican products, as Trump has threatened, would overwhelm the companies that move imports through U.S. customs checks, according to Eduardo Acosta, vice president of R.L. Jones Customhouse Brokers in San Diego.

The U.S. government last month automatically debited R.L. Jones’s bank account for roughly $700,000 in duties owed by its clients. That monthly tab will swell to an estimated $19 million in June if the tariffs take effect, outstripping the firm’s resources, he said.

Though the tariff threat is aimed at spurring action in Mexico, significant disagreements remain about how quickly and how much Mexico can reduce unauthorized migration through tougher enforcement measures, the U.S. official said. Last month, U.S. authorities made more than 144,000 arrests along the southern border, the highest monthly total in 13 years.

Mexico has told the United States that its national guard deployment — along with promises to build more migrant detention centers and checkpoints to catch Central Americans and deter their passage — will quickly reduce migration flows to the levels of last fall, when arrests averaged about 60,000 per month.

Trump officials have told Mexico that is not enough, making it clear that the White House will be satisfied only with a return to the numbers tallied in the months after Trump was inaugurated, when arrests fell below 20,000, the lowest level in half a century.

U.S. authorities continue to push for a more forceful and intimidating enforcement approach from Mexico, while Mexico is urging the United States to address the underlying structural problems in Central America — poverty, violence and drought — that are driving emigration.

Trump gave indications Thursday that the talks had made progress, but he told reporters that he had not made up his mind.

“Something pretty dramatic could happen,” he said, referring to the talks with Mexican officials, which continued Thursday. “We’ve told Mexico the tariffs go on. And I mean it, too.”

Trump also dismissed Republican senators’ threat to block his tariff plans, saying they “have no idea what they’re talking about when it comes to tariffs.”

Trump spoke before leaving Shannon, Ireland, for Normandy, France, where he took part in ceremonies commemorating the 75th anniversary of the D-Day landings that helped turn the tide of World War II in favor of the Allies.

Mexico said it will deploy 13 contingents of newly formed national guard units that will operate like a militarized police force, with 10 groups of 450 to 600 troops assigned to the border with Guatemala. Three additional contingents will be deployed to the Isthmus of Tehuantepec in southern Mexico, a geographic chokepoint, to set up roadblocks and highway checkpoints.

By September, up to 6,000 national guard troops will be deployed in southern Mexico, up from the force of 1,500 federal police officers currently there, officials said.

“That’s a remarkable and significant commitment of resources beyond what they’ve previously dedicated to countering human smuggling,” said the U.S. official familiar with the negotiations. “It’s also remarkable that they have identified the need for more detention, processing and repatriation ability, which will be necessary for any sustained effort.”

The senior Mexican official said the soaring arrests by U.S. Customs and Border Protection — which have topped 100,000 for three months in a row — have forced the government of President Andrés Manuel López Obrador to depart from an approach of welcoming Central Americans.

The U.S. negotiators are urging Mexico to more aggressively broadcast to migrants that their country cannot be a transit point for an unauthorized journey to the United States.

Mexican officials are looking for the Trump administration to commit to programs that will ease some of the short-term pressures in Central America that are fueling migration, especially crop failures and hunger. They at one point told Vice President Pence, McAleenan and Secretary of State Mike Pompeo that the United States could have a major impact by “investing $10 million for irrigation equipment in rural Honduras.”

A Trump official said Thursday that Mexican attorneys and White House lawyers were meeting to discuss the accord. The Mexican official also cautioned that the legal framework for the accord had yet to be hashed out.

On Capitol Hill, House Ways and Means Committee Chairman Richard E. Neal (D-Mass.) said he would introduce a resolution of disapproval if the president proceeds with the tariffs. Lawmakers could thwart Trump’s import tax plan only if they can deliver a two-thirds vote, enough to override a presidential veto.

“The president’s proposed tariffs would hurt American workers, businesses, and consumers. Commandeering U.S. trade policy to influence border security is an abuse of power,” Neal said.

As Trump pushes ahead, business leaders and members of his own party are scrambling to head off the imposition of tariffs that could result in Mexican retaliatory measures targeting U.S. farmers and manufacturers.

Through April, Mexico was the largest U.S. trading partner. Last year, when it ranked third behind China and Canada, Mexico shipped almost $350 billion worth of autos, auto parts, industrial machinery and farm products to U.S. customers.

Businesses across the United States are scrambling to draw up contingency plans.

“We’re very concerned,” said Adam Briggs, vice president of sales and marketing for Trans-Matic Manufacturing in Holland, Mich. “Businesses crave certainty. When the rules are constantly changing, we have a hard time.”

Sieff reported from Mexico City. Josh Dawsey contributed to this report.