The German leader, who has clashed with the US president in recent weeks, will arrive in Mexico with a large business delegation, seeking to expand a relationship that saw the countries do $17.8 billion in trade last year.
Mexico, on the receiving end of much vitriol from Trump, has been actively wooing other countries because of fears for the future of its crucial trade relationship with the United States.
It is particularly keen to deepen ties with Germany, whose major automakers – Volkswagen, Audi and soon BMW – have opened major plants in Mexico and contributed to making the country the world's seventh-largest auto producer.
One of the reasons is Mexico's duty-free access to the US market under the North American Free Trade Agreement (NAFTA) – which Trump now wants to renegotiate, saying the 23-year-old deal has shipped American jobs south of the border.
But German companies see Mexico as much more than a trampoline into the US.
“They didn't come with a focus solely on the United States,” said Björn Lisker, spokesman for the Mexican-German Chamber of Commerce and Industry.
“Audi builds the Q5 model for the world market in the state of Puebla. The United States is a factor, yes, but it's not the only factor in those companies' decision to come to Mexico.”
German foreign direct investment in Mexico reached $2.4 billion last year – more than any other country except the United States and Spain.
The automobile and manufacturing industries get the most attention, but other sectors have also made major investments.
“The German pharmaceutical industry has a strong presence in the country. So do the chemical, electrical and electronics industries. These are important products that we are trading in both directions,” Lisker told AFP.
My enemy's enemy
There are 1,900 companies in Mexico with German capital, generating 120,000 jobs, he said.
More than 8,500 Germans live in Mexico.
Still, Mexico's relationship with the United States dwarfs any other, accounting for 80 percent of its exports – $294.2 billion in goods last year.
Mexico has been one of Trump's favourite targets ever since he launched his presidential campaign referring to the country's immigrants as drug dealers and rapists.
His vows to overhaul NAFTA and force Mexico to pay for a border wall have driven relations between the two neighbours to their lowest point in recent memory.
To some observers, Trump's presidency has brought to mind long-time Mexican dictator Porfirio Diaz's old saying: “Poor Mexico, so far from God, so close to the United States.”
Germany has also been at the receiving end of Trump's attacks – ever since Merkel warned in May that Europe can no longer count on US leadership and “must take its fate into its own hands.”
Trump fired back in typical fashion on Twitter.
Room to grow?
“We have a MASSIVE trade deficit with Germany, plus they pay FAR LESS than they should on NATO & military. Very bad for US. This will change.”
Merkel's trip – which follows a visit to Argentina, another Latin American economic powerhouse – thus comes at a key time in Mexican-German relations.
“Chancellor Merkel's official visit strengthens this relationship, especially given the current geopolitical moment,” said Alonso de Gortari of ProMexico, the country's trade and investment promotion agency.
“Because of recent events, the Mexican and German positions coincide more than ever.”
The countries' trade relationship has room to grow – as it will likely do under Mexico's free trade deal with the European Union, in place since 2000.
Sixty-five percent of German companies in Mexico say they expect their business here to get bigger in the next 12 months.
“It's a process of integration with extensive economic repercussions, which not only increase direct investment and employment but also economic growth,” De Gortari told AFP.