Last year – as the US elected a president who described Mexicans as rapists, promised to build a border wall and threatened to tear up free trade agreements – the poor performance of Mexico’s national football team seemed to offer a dark omen for the country.

El Tri – as the team is known for its tricolor kit – lost 7-0 to Chile in the Copa América tournament, and its hopes for reaching the 2018 World Cup seemed be dwindling by the day.

But the team kicked off the Trump era with a 2-1 victory over the US in Columbus, Ohio, four days after the election, and has since then sailed through World Cup qualifying matches.

On Sunday, Mexico will once again confront the US – this time on home ground at the Estadio Atzeca. A victory here would almost guarantee its spot in Russia 2018.

Similarly, the darkest fears prompted by Trump’s victory have given way to cautious optimism across Mexico.

Early fears that US protectionism could unravel 25 years of economic integration have faded. Investors are feeling bullish again. Even the peso, which plummeted in the days after the US election, has recovered, hitting a 10-month high Thursday.

“Mexico is no longer the tiny partner you can bully around,” said José Merino, a political scientist at the Autonomous Technological Institute of Mexico (Itam). “We’ve turned into a very competitive world exporter.”

The rebound also stems from a consensus that the disaster scenarios spun as Trump prepared to take office are unlikely to materialise. Investors are betting that the integration of the US and Mexican economies, with firms establishing supply chains on both sides of the border, is too deeply established to uproot.

“At end of last year everything was so grim and dark expectations were low, people weren’t expecting anything nice from new US government … but what we’ve seen is somewhat less discouraging,” said Valeria Moy, director of México, ¿Cómo Vamos?, a thinktank.

“It’s not extraordinary, but it’s fine. We’re starting to see good economic data: inflation is high but it’s a temporary phenomenon. Expectations shifted a bit and we’re seeing a more optimistic mood right now.”

Mexicans might be breathing easier, but Trump is still a source of deep anxiety. His abrupt decision to withdrawn from the Paris climate accord was taken as a warning of what could come in a renegotiation of the Nafta free trade agreement.

“Of course we worry. This guy’s unpredictable,” said Manuel Molano, director of the Mexican Institute for Competitiveness, a thinktank. “All Mexicans have a votive candle lit to the Virgin of Guadalupe for the impeachment of Trump.”

Although Trump’s government has moved aggressively against undocumented people inside the US, it has made little progress with his plans for a frontier wall.

Meanwhile, the two countries reached a deal on sugar exports this week, triggering hopes that Nafta renegotiations could come to a similar conclusion. That is important for an economy that has shifted from depending on petroleum production to manufacturing for export and sends 80% of its products to the United States.

Exports are growing, and GDP forecasts have grown increasingly rosy.

Cautious optimism marks a sharp reversal from the days of the Trump transition, when the president-elect’s tweeting terrorized the Mexican economy.

Ford cancelled a major investment in the state of San Luis Potosí, sparking fears of a rush back across the border. Other automakers, such as BMW, which is building a plant in the state, subsequently committed to staying the course, however.

New companies exploring new investments “are taking a wait-and-see-approach”, while “the ones already here have growth and investment plans like we do”, said François Ouellet, business development director at the Canadian auto parts supplier Exo-s, which operates a plant in the state of Querétaro.

In some ways, Trump is just another problem in a long list. Crime in Mexico has surged and 2017 is on pace to be the most violent year in Mexico in 20 years, according to crime statistics.

Corruption is also rife; three former state governors have been detained abroad on graft accusations. Corruption is endemic, and recent state elections were plagued with reports of vote-buying.

Most Mexicans, however, are more likely to trust the country’s football team than its politicians. “Nationalism is best seen in football, especially against the United States,” said Ilán Semo, a historian at the Iberoamerican University. “It distracts people, but it’s also a battlefield.”