The election of Donald Trump as U.S. president last year raised the specter of economic recession in Mexico, sent the country's peso into a tailspin, and threatened local industry such as car making.
But four months on, Mexican automobile output is accelerating fast, unemployment is at a nine-year low, and the peso has been one of the world's best-performing currencies in 2017.
Since diplomatic ties reached a nadir in January with the cancellation of Mexican President Enrique Pena Nieto's planned meeting with Trump, business confidence has slowly returned.
Fears that Trump could tear up the NAFTA trade treaty have subsided, and so far the hit to foreign investment has been slight, said Gilberto Fimbres, head of Mexican employers' federation Coparmex in the northern border city of Tijuana.
"The storm of the great talker, the big negotiator, descended on us," he said. "Then it turns out that all these great things, the great threat, weren't so great in the end."
Instead, Mexican auto production leapt 36 percent in March, capping the strongest start to any year since 2011. The same month, growth in new manufacturing orders was the highest in six months, the Markit Purchasing Managers' Index showed.
As a result, areas most exposed to the threat of a trade war are now looking ahead with cautious optimism.
Baja California, a major draw for manufacturers supplying the U.S. market, expects to book $2.7 billion in foreign direct investment (FDI) this year, up from about $2.5 billion in 2016, said Carlo Bonfante, the border state's economy minister.
Companies investing in the state this year include China's Kunshan Eson Precision Engineering, Korea-based electronic components maker INZI DISPLAY, and U.S. drinks company Constellation Brands although its plans are facing opposition from local farmers worried about water supply.
In Guanajuato state in central Mexico, a car making hub, the industry is likely to create some 20,000 new jobs this year, an increase of about 10 percent from 2016, said Alfredo Arzola, director of the local automotive cluster.
Arzola declined to give specific examples, saying that "absolutely all" the auto sector companies in Guanajuato, which include General Motors, Honda and Volkswagen, were adding jobs.
Broader surveys present a similar picture.
A poll of 868 foreign and domestic executives by consultancy KPMG showed 58 percent planned to expand operations in Mexico in the next three years, up three percentage points from a year earlier. Though published in March, the survey was conducted November-December at the height of uncertainty over Trump.
Maurizio Rosa, chief executive of Codan Rubber Mexico, a maker of hoses for the automotive industry, said his worries about Trump began to fade when U.S. clients persuaded him that Mexico was indispensable to their business.
"If you take away the low-cost parts the U.S. buys from Mexico, it's going to be very difficult for them," said Rosa, who expects Codan's sales to rise around 30 percent this year.
Rosa declined to name his clients, but said they included parts suppliers to global automakers including Nissan, Fiat Chrysler and Ford.
Risks to economic growth still loom, including government spending cuts, rising interest rates, low oil production, and lingering fears over Trump's plan to renegotiate the North American Free Trade Agreement (NAFTA) between Mexico, the United States and Canada.
Trump's threats to slap import tariffs on Mexican-made cars in the weeks after his victory pummeled the peso. However, the currency's slump helped spur a revival in exports and tourism.
Concern about NAFTA still clouds investment, and on March 31 the government cut its 2017 growth forecast by 0.7 points to around 1.8 percent.
Still, private sector economists who cut growth forecasts last year on fears Trump could choke the economy are starting to revise up estimates, citing stronger data and a softer tone from U.S. officials over trade in recent weeks.
Much depends on consumer sentiment, which hit a record low when Trump took office in January, the same month the government ushered in an inflation-boosting gasoline price hike.
But the more conciliatory U.S. tone, a drop in unemployment to its lowest rate since December 2007, and the peso's appreciation over the past 2 1/2 months have helped confidence rebound.