President Trump visited the U.S.-Mexico border in Calexico, Calif., on Friday. (Kevin Lamarque/Reuters)

Last week, as he was preparing to head to California to tour the U.S.-Mexico border, President Trump tweeted a threat.

“Mexico, for the first time in decades, is meaningfully apprehending illegals at THEIR Southern Border, before the long march up to the U.S.,” he wrote. “This is great and the way it should be."

“However,” he added in the next tweet, “if for any reason Mexico stops apprehending and bringing the illegals back to where they came from, the U.S. will be forced to Tariff at 25% all cars made in Mexico and shipped over the Border to us. If that doesn’t work, which it will, I will close the Border.”

These threats aren’t new ones. Trump has repeatedly used tariffs as a stick in negotiations with foreign countries, such as China and Germany. But there’s a distinct problem with making that specific threat against Mexico: The United States already agreed that it wouldn’t.

One of Trump’s signature proposals during the 2016 election was to revisit the North American Free Trade Agreement, or NAFTA. Trump would regularly deride the trade deal as one of the worst in history, and he pledged that, if elected, he might start over on trade talks with Mexico and Canada, the two other participants in the agreement.

He did so. In October, his administration announced the U.S.-Mexico-Canada Agreement, or USMCA, a trade deal that most observers agreed offered relatively modest changes to the provisions in NAFTA. It will probably go before Congress for ratification this year. The agreement also included several side letters, one of which, already in effect, explicitly exempts both Canada and Mexico from tariffs imposed by the United States on as many as 2.6 million vehicles imported into the United States each year.

This wasn’t an accident. Trump’s threat “is the exact scenario that the Mexican negotiating team predicted and secured protections from in the USMCA,” trade lawyer Daniel D. Ujczo told the Associated Press. “Mexico ‘Trump-and-Tweet-proofed’ its auto sector,” he said, adding that Trump “would need to get very creative to impose auto tariffs on Mexico" in light of that agreement.

In an interview with Fox News on Saturday, Trump again reiterated the idea that he might bring Mexico to heel with tariffs.

“We’ve had a great four days," he told Fox host Griff Jenkins, “and it only started when I said we’re going to close the border. And I will close the border. Or I’ll put the tariffs on the cars that they make and they send into our country essentially tax-free, and I’ll put tariffs on there, and then I’ll close the border after that if that doesn’t.”

Jenkins pushed back.

“How would you put a tariff when your own agreement precludes that?" he asked.

“We haven’t finished our agreement yet,” Trump said. “So I’ll put that in there. I’m going to put it in there, because if they look, people are pouring through Mexico.”

He . . . hasn’t finished the agreement yet? The USMCA, which Trump late last month told Republicans on Capitol Hill that he wanted to have ratified before summer? That’s interesting to hear.

In that series of tweets Friday, Trump took a different angle, alleging that punishments imposed against Mexico would “supersede USMCA.” This is somewhat hard to interpret, at least in the context of countries adhering to multinational trade agreements to which they’re signatories.

The good news is that Trump decided such a move wasn’t necessary over the short term, given those “great four days” on Mexico’s part. As we noted on Friday, Mexican authorities denied having changed their immigration policies. And by not changing those policies, Trump was happy enough that he decided against imposing tariffs the United States has agreed it won’t impose.

Crisis averted.