President Trump tweeted Friday night that a deal had been signed with Mexico to avoid tariffs that were set to start Monday. The State Department will release the details of the agreement, but Mr. Trump announced Mexico “has agreed to take strong measures to … stem the tide of migration.”

“I am pleased to inform you that The United States of America has reached a signed agreement with Mexico,” the president tweeted Friday night. “The Tariffs scheduled to be implemented by the U.S. on Monday, against Mexico, are hereby indefinitely suspended. Mexico, in turn, has agreed to take strong measures to…stem the tide of Migration through Mexico, and to our Southern Border. This is being done to greatly reduce, or eliminate, Illegal Immigration coming from Mexico and into the United States. Details of the agreement will be released shortly by the State Department. Thank you!”

But a deal was far from certain, with the White House failing to publicly identify what targets Mexico needed to meet, and insisting that what Mexico was offering to curb illegal immigration was insufficient. Top White House officials had insisted the tariffs were imminent, if Mexico didn’t drastically crack down on the flow of migrants.

Mr. Trump appeared to muddle the waters even more Friday afternoon while tweeting from Air Force One that Mexico must buy more agricultural products from the U.S. — even though the White House insisted the proposed tariffs were about immigration, not trade.

“If we are able to make the deal with Mexico, & there is a good chance that we will, they will begin purchasing Farm & Agricultural products at very high levels, starting immediately,” Mr. Trump tweeted. “If we are unable to make the deal, Mexico will begin paying Tariffs at the 5% level on Monday!”

For months, Mr. Trump has vocalized his frustration over illegal immigration levels and sought ways to stem the tide of migrants, as he attempts to keep his campaign promise to build a border wall and handle illegal immigration more effectively than his predecessors. But those attempts have been fraught with hurdles, both legal and political, with the 2020 presidential election just around the corner.

In December, Mr. Trump’s insistence on border wall funding led to the longest government shutdown on record, but the president ultimately caved on that when the impacts of the shutdown became visible.