Like the rest of the world, Mexico only learned through media reports that the Trump administration was considering a draft executive order to withdraw the United States from the North American Free Trade Agreement.
Mexico's top diplomat said Thursday that President Enrique Pena Nieto's government immediately launched a diplomatic full-court press. That led to a Pena Nieto phone call with President Donald Trump, a U.S. promise not to leave NAFTA for now and a commitment by all three nations in the pact to work on renegotiating it.
Mexico and the U.S. still have points of disagreement but "we are advancing in the right direction," Foreign Relations Secretary Luis Videgaray said.
But just as Trump warned that he was still prepared to walk away from NAFTA unless he gets "a fair deal for the United States," Videgaray noted there is no reason for Mexico to stay either if negotiations are unfavorable to it.
In an interview with the Televisa network, Videgaray gave a blow-by-blow account of Mexico's response after it first saw reports about the draft order around midmorning Wednesday.
Mexican officials reached out to various interlocutors in the U.S. government who, he said, told them that no final decision had been made and the draft was under consideration more as a way to pressure the U.S. Congress to speed up the process of getting to the negotiating table.
Senate confirmation of Robert Lighthizer as Trump's nominee for U.S. trade representative, who would lead the United States in NAFTA talks, has taken longer than anticipated.
Mexican officials continued to talk to their U.S. counterparts as the hours passed, and toward the end of the day Pena Nieto called Trump for a conversation that lasted about 20 minutes.
Videgaray said the Mexican president told Trump that he was aware of internal U.S. politics, but that signing an order for the U.S. to quit NAFTA "would naturally have very negative consequences in Mexico, that for Mexico it would be practically impossible to negotiate under such conditions."
Indeed, the uncertainty over NAFTA had by then helped send the Mexican peso plunging about 1.7 percent to close at 19.21 to the U.S. dollar Wednesday. According to an analysis by Banco BASE, it was the biggest single-day depreciation for the currency since Jan. 18.
Trump and Pena Nieto "agreed that that option would not be taken, but instead we would continue along the path of negotiation," Videgaray told Televisa.
The peso recovered to 19.03 to the dollar Thursday, after the governments issued parallel statements committing to renegotiating NAFTA.
Canadian Prime Minister Justin Trudeau had a similar phone call with Trump on Wednesday in which he told the U.S. president that canceling NAFTA would cause a lot of disruption and be painful for many families.
"I'm happy to engage with the president regularly," Trudeau said Thursday. "What we've talked about over the last couple of days is trade and I've been emphasizing that NAFTA has been improved a dozen times over the last 20 years."
Neither Videgaray nor Trudeau mentioned whether the Mexican and Canadian governments were in communication or coordinated their efforts. But in the past the two countries have spoken of supporting each other in NAFTA discussions.
Late Thursday, the Mexican government issued a statement saying Pena Nieto and Trudeau spoke by phone that same day to discuss NAFTA.
"They agreed to remain in close communication to ensure that the process of modernization (of the pact) is successful, to the benefit of both nations," Pena Nieto's office said.
Some analysts suggested that with the Trump administration approaching its 100-day mark and the clock ticking on NAFTA, the draft order could have been an attempt for the U.S. president to flex some muscle over the negotiations.
Jorge Guajardo, a former Mexican diplomat and senior director at the Washington-based international strategy firm McLarty Associates, said he doubted it was merely a ploy to twist the arms of U.S. lawmakers.
"You don't go and float these rumors and have the markets crash, and currencies, and threaten bilateral relations just to prod your own party into acting in Congress," Guajardo said.
On Thursday, Trump struck a largely conciliatory tone, acknowledging that ending NAFTA would be a "shock to the system" and saying he has "very good" relationships with both Pena Nieto and Trudeau.
"So they asked me to renegotiate. ... Now, if I'm unable to make a fair deal, if I'm unable to make a fair deal for the United States, meaning a fair deal for our workers and our companies, I will terminate NAFTA," Trump said. "But we're going to give renegotiation a good strong shot."
As a candidate, Trump frequently called NAFTA a "disaster" and vowed to renegotiate its terms or scuttle it altogether.
Guajardo warned that "bullying tactics" could potentially sour Mexico on a relationship that's worth some $583.6 billion in annual bilateral trade.
"NAFTA, at the end of the day, I think will be saved. But the well will be poisoned," he said.
Associated Press writer Charmaine Noronha in Toronto contributed to this report.
Follow Peter Orsi on Twitter at www.twitter.com/Peter_Orsi