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 Mr. Pena Nieto phone call with President Donald Trump, a US 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 US still have points of disagreement but “we are advancing in the right direction,” Foreign Relations Secretary Luis Videgaray said.

But just as Mr. Trump warned that he was still prepared to walk away from NAFTA unless he gets “a fair deal for the United States,” Mr. Videgaray noted there is no reason for Mexico to stay either if negotiations are unfavorable to it.

In an interview with the Televisa network, Mr. Videgaray gave a blow-by-blow account of Mexico’s response after it first saw reports about the draft order around midmorning on Wednesday.

Mexican officials reached out to various interlocutors in the US 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 US Congress to speed up the process of getting to the negotiating table.

Senate confirmation of Robert Lighthizer as Mr. Trump’s nominee for US trade representative, who would lead the United States in NAFTA talks, has taken longer than anticipated.

Mexican officials continued to talk to their US counterparts as the hours passed, and toward the end of the day Mr. Pena Nieto called Mr. Trump for a conversation that lasted about 20 minutes.

Mr. Videgaray said the Mexican President told Mr. Trump that he was aware of internal US politics, but that signing an order for the US 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 per cent to close at 19.21 to the US dollar Wednesday. According to an analysis by Banco BASE, it was the biggest single-day depreciation for the currency since January 18.

Mr. Trump and Mr. Pena Nieto “agreed that that option would not be taken, but instead we would continue along the path of negotiation,” Mr. Videgaray told Televisa.

The peso recovered to 19.03 to the dollar yesterday, after the governments issued parallel statements committing to renegotiating NAFTA.

Canadian Prime Minister Justin Trudeau had a similar phone call with Mr. Trump on Wednesday in which he told the US 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,” Mr. Trudeau said on 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.”