The Mexican president, Andrés Manuel López Obrador, travelled to the border city of Tijuana to rally the country in “defence of national dignity”, but to also reaffirm friendship with the US people – barely a day after the US cancelled the threat of tariffs.

López Obrador called the rally, which was convened prior to the tariffs being cancelled, a “celebration” of both countries brokering a deal.

President Trump had threatened to impose 5% tariffs from Monday on all Mexican goods, if Mexico did not agree new measures to stem migration from Central America.

At the rally in Tijunana, López Obrador said: “We’re celebrating yesterday’s important agreement because it was putting us in a very difficult situation with these tariffs because we would have had to impose the same measures on US products.”

“What follows? Keeping our commitments: reinforcing our [southern] border, applying the law and respecting the human rights” of migrants.

Mexico’s foreign minister and chief negotiator on the tariffs, Marcelo Ebrard, also spoke at the rally: “We didn’t win everything, but we were able to claim a victory with there being no tariffs.”

He added that the country had emerged with its “dignity intact”.

Trump’s threatened tariffs would have dented Mexico’s export-driven economy and inflicting additional uncertainty on a slowing economy.

López Obrador, commonly called AMLO, has avoided antagonising Trump – to the point he flashed the peace sign with both hands when asked to comment Friday on his US counterpart.

In his Tijuana speech, AMLO offered anecdotes from past periods of cordial US-Mexico relations, noting that more than a million Americans resided in Mexico and stressed the importance of Mexico as a market for US merchandise.

“I’m not raising a closed fist, rather an open and direct hand to President Donald Trump,” López Obrador said.

AMLO promised on the campaign trail last year “not do the dirty work” of any foreign government on the issue of migration. His administration started issuing humanitarian visas to migrants arriving in Mexico, but stopped the process due to crushing demand – and perceptions migrants were simply using the documents to hasten trips through Mexico to the US border, rather than seeking opportunities in the country.

US border officials have detained migrants in numbers not seen in more than a decade, stoking Trump’s ire.

In its deal with the US, Mexico promised to send 6,000 members of a newly-formed militarised police to its southern states. It also will accept the expansion of a program known as Remain in Mexico. Under the scheme, those seeking asylum in the US will wait in Mexico for their claims to be processed. Mexico has pledged to provide them with employment programs and social services for those waiting.

One AMLO ally, lower house speaker Porfirio Muñoz Ledo, called the arrangement with the US, “immoral and unacceptable, the double standard between the (Mexican) northern and southern border. On the one hand, we demand that they open the doors to us [in the north] and on the other, we seal off the passage of Central Americans to do the US a favour.”

Mexico’s President López Obrador greets supporters at a rally in Tijuana he said was a ‘celebration’ of the deal with the US that avoided tariffs on Mexican exports. Photograph: Guillermo Arias/AFP/Getty Images

AMLO once again promoted plans to pump billions of dollars into Central America to spur development and eradicate the root causes of migration in some of the poorest, most violent and most corrupt countries in the hemisphere – which are also grappling with the early impact of climate change.

Mexico has already increased enforcement ahead of agreeing to do more in its deal with the US. Immigration officials and soldiers recently stopped a caravan barely a day after it crossed the border.

It also detained two members of a migrant-rights collective, Pueblo Sin Frontera, which accompanies caravans. The finance ministry also froze the bank accounts of 26 individuals accused of financing caravans.

Support for migrants appears to be waning in states such as Chiapas, where caravans were once warmly received, but are now shunned and viewed with suspicion.

“[AMLO] doesn’t pay a political price for repressing migrants. And he may gain something of a bonus here and there,” said Federico Estévez, political science professor at the Autonomous Technological Institute of Mexico. “They fundamentally do not enjoy support in Mexico.”