Just four months ago, investors in Mexico were bracing for disaster. Trade agreements were sure to be ripped up. Thousands of jobless Mexicans, expelled from their American homes, would flood back across the border. And the peso? Analysts could hardly cut their forecasts fast enough.

Turns out, life in the era of Donald Trump hasn't been that bad so far.

Mexico's benchmark equity index has erased the losses triggered by Mr. Trump's win in November and is actually up 7 per cent this year. The peso, the world's biggest loser in 2016, is now staging a surprise rally that puts it atop the emerging-market heap. Investors including Discovery Americas say they're investing in Mexico again after putting purchases on hold at the start of the year.

Story continues below advertisement

In explaining the about-face, executives and bankers point out that U.S. officials have softened their tone quite a bit since Mr. Trump's Mexico-bashing days on the campaign trail.

U.S. Treasury Secretary Steven Mnuchin says negotiations to renegotiate the North American free-trade agreement could spell a win-win for both sides. Commerce Secretary Wilbur Ross says he anticipates a sensible deal. And Peter Navarro, who leads the White House National Trade Council, said he wants Canada, Mexico and the United States to become a global manufacturing powerhouse. Some of the President's early stumbles, such as the collapse of the health-care bill, have also underscored how hard it is to make any drastic changes in Washington.

As Mr. Trump also scales back the Twitter attacks on the U.S.'s third-biggest trading partner, investors are again turning their attention to Mexico's economic indicators, which have held up relatively well.

"When you see that car sales are still going up, same-store sales growth is doing well, loan demand is still going up and loans are behaving well – you realize it's not just naive optimism," said Carlos Hank Gonzalez, chairman of Grupo Financiero Banorte SAB, Mexico's fourth-biggest bank by outstanding loans, also based in Acapulco. "It's based on real change."

Mexican stocks have shown resilience. The country's benchmark equity gauge reached a record high last week, and all but eight of the 35 companies on the index have posted gains this year. Grupo Elektra SAB, a banking and retail company owned by billionaire Ricardo Salinas, has advanced the most, rising 73 per cent. OHL Mexico SAB, a unit of Spanish builder Obrascon Huarte Lain SA, has added 29 per cent, while silver miner Industrias Penoles SAB is up 24 per cent.

"We're seeing a substantial recovery in Mexico," Martin Marron, the chief executive officer for JPMorgan in Latin America and Canada, said in an interview. "There's been a recovery from the losses that financial assets suffered before, during and after the rise of Team Trump."

Last week, investors saw signs that Mexico's dormant IPO market is coming back to life. Banco del Bajio SA is said to be reviving plans from three years ago to raise as much as $300-million (U.S.). Mexican lender Banca Mifel SA, which is backed by Advent International, is also considering an IPO, people familiar with the matter said last week. And Nexxus Capital-backed fast-food operator Taco Holding SA is seeking to raise $100-million by going public in the third quarter of this year, CEO Javier Rancano said Thursday. Only one Mexican company has gone public in the past six months.

Story continues below advertisement

American manufacturers, once frozen by Mr. Trump's threats of retaliation, are even sending jobs south again. Illinois Tool Works Inc., Triumph Group Inc. and TE Connectivity Ltd. are among companies scaling back or even shutting U.S. manufacturing operations and adding workers in Mexico.

Trade between Mexico and the United States has grown fivefold to more than $500-billion a year since NAFTA took effect in 1994. NAFTA, which phased out most tariffs among the three countries over the past two decades, has proven crucial to Mexico's emergence as a manufacturing hub.

The softer tone on Mexico may not last forever, with White House officials insisting there's been no change in Mr. Trump's goals for NAFTA talks. The United States could push for changes to the trade agreement that boost tariffs in certain industries, change tax treatment, expand opportunities for agriculture and strengthen rules of origin that favour the U.S. economy, according to the draft of a letter from the administration to Congress that circulated last week.

Risks to Mexican markets could also come from within. The front-runner in early polls for the 2018 presidential election, Andres Manuel Lopez Obrador, has raised red flags among investors for his promises to boost social-welfare spending and his opposition to allowing private investors in industries that have traditionally been run by the state, including oil.

"Let's not forget that at the end of the year we have another speed-bump, which is the start of the political campaigns," Arturo Jose Saval Perez, senior managing director at private equity firm Nexxus Capital, said at a conference hosted by Amexcap, Mexico's private equity association. "That's going to cause headline risk."

In the meantime, investors are hitting the restart button.

Story continues below advertisement

"We put our investing on hold for two months. We're now investing again," said Carlos Mendoza, senior managing director at Discovery Americas, during the same conference. The U.S. elections marked "a bad day for Mexico. But I think at the end of the day, it's going to be a good thing because it lit a fire under people to act."