Mexico has agreed to take “unprecedented steps” to help stem the flow of migrants to the US in order to avoid trade tariffs threatened by President Donald Trump.
Mr Trump revealed that a deal had been reached to suspend the tariffs “indefinitely” in a series of tweets.
He had threatened to implement import duties of 5%, rising every month, unless Mexico acted to curb migration.
The tariffs were due to come into effect on Monday.
Is there a crisis on the US-Mexico border?
The deal, also confirmed in a tweet by Mexico’s Foreign Secretary Marcelo Ebrard, comes at the end of three days of negotiations, which saw Washington demand a crackdown on Central American migrants.
Mr Trump caught members of his own party unaware when he announced the proposed tariffs last week.
He had declared an emergency on the US-Mexico border in February, saying it was necessary in order to tackle what he claimed was a crisis with thousands of undocumented migrants crossing the frontier.
What do we know about the deal?
In a joint declaration released by the US State Department, the two countries said Mexico would take “unprecedented” steps to curb irregular migration and human trafficking.
But it seems the US did not get one of its reported key demands that would have required Mexico to take in asylum seekers heading for the US and process their claims on its own soil.
Under the deal, Mexico agreed to:
Deploy its National Guard throughout the country from Monday, pledging up to 6,000 additional troops along Mexico’s southern border with Guatemala
Take “decisive action” in tackling human smuggling networks
The US also agreed to:
Expand its programme of sending asylum seekers back to Mexico while they awaited reviews of their claims. In return, the US would “work to accelerate” the adjudication process
Both countries pledged to “strengthen bilateral co-operation” over border security, including “co-ordinated actions” and information sharing.
The declaration added that discussions would continue, and final terms be accepted and announced within 90 days.
Should Mexico’s actions “not have the expected results”, the agreement warned that additional measures could be taken, but did not specify what these would be.
Mr Ebrard told journalists that the deal was a “fair balance” between both nations.
Trump tariff threat recedes – for now
By Will Grant, BBC Mexico and Central America correspondent
It’s still unclear whether it was internal pressure within his party or the measures being offered by Mexico that dissuaded Mr Trump from implementing the plan. Or perhaps simply an appreciation of its potential consequences.
It became apparent during the talks just how intertwined the two neighbouring economies are and many argued that a 5% tax on all Mexican goods would hurt US suppliers and customers too.
Furthermore, damaging the already fragile Mexican economy could have pushed it into a full recession and created more migrants heading north in search of work.
Still, some considered the bilateral meetings were useful, in part to recognise that both nations are facing an unprecedented rise in undocumented immigration. The plan to deploy military personnel to Mexico’s southern border may well have helped bring this dispute to an end. However, President Trump has now tied immigration to bilateral trade and could easily do so again in the future should the situation fail to improve.
What is the reaction in Mexico?
President Andrés Manuel López Obrador ran for office vowing to stand up to the US and once said he would not allow Mexico to be Mr Trump’s “whipping boy”.
But some politicians felt he had given too much, too quickly, and they demanded to see details of the deal.
Ángel Ávila Romero, a senior member of the left-wing PRD party, said the agreement was “not a negotiation, it was a surrender”.
“Mexico should not militarise its southern border. We are not the backyard of Donald Trump,” he tweeted.
Marko Cortés, leader of the conservative National Action Party (PAN), said the sovereignty and dignity of Mexico had been damaged, newspaper El Universal reported.
Mr López Obrador said on Twitter that a rally in the border city of Tijuana on Saturday to celebrate Mexican sovereignty would go ahead.
Who is President López Obrador?
What tariffs had Trump threatened?
Under his proposal, duties would have risen by 5% every month on goods including cars, beer, tequila, fruit and vegetables until they hit 25% in October.
Mexico is currently one of the largest trading partners of the US, just behind China and Canada – two countries also locked in trade disputes with the US.
What’s the situation on the US-Mexico border?
On Wednesday, US Customs and Border Protection announced that migrant detentions had surged in May to the highest level in more than a decade.
Border Patrol apprehended 132,887 migrants attempting to enter the US from Mexico in May – a 33% increase from the month before.
The arrests were the highest monthly total since Mr Trump took office.
“We are in a full-blown emergency, and I cannot say this stronger, the system is broken,” said acting CBP Commissioner John Sanders.
Official figures show illegal border crossings have been in decline since 2000.
In 2000, 1.6 million people were apprehended trying to cross the border illegally – that number was just under 400,000 in 2018.
In 2017, Mr Trump’s first year in office, the figures were the lowest they had been since 1971.