President Donald Trump dropped his threat of tariffs against Mexican goods on Friday, announcing via Twitter that he had reached a deal with Mexico to stem immigration through the southern border.

The State Department said in a statement that Mexico agreed to deploy its national guard throughout that country "giving priority to its southern border."

The department also announced Friday the U.S. would expand its "migrant protection protocols" that requires migrants seeking asylum in the United States to stay in Mexico until their cases are processed.

It said Mexico would authorize people to enter for humanitarian reasons "while they await the adjudication of their asylum claims."

"I am pleased to inform you that The United States of America has reached a signed agreement with Mexico," Trump tweeted. "The Tariffs scheduled to be implemented by the U.S. on Monday, against Mexico, are hereby indefinitely suspended."

He said Mexico had agreed to "strong measures" to stem the tide of immigrants through the country on their way to the U.S.

Mexico will try very hard, and if they do that, this will be a very successful agreement for both the United States and Mexico! — Donald J. Trump (@realDonaldTrump) June 8, 2019

For the 5 percent tariffs to have gone into effect June 10, Trump would have had to sign an executive order directing them to do so on Friday, a White House official confirmed to NBC News.

Mexican Foreign Minister Marcelo Ebrard said outside the State Department Friday night that he thought the deal struck "a fair balance" because the U.S. "had more drastic proposals and measures at the start."

Secretary of State Mike Pompeo thanked Ebrard on Friday night "for his hard work to negotiate a set of joint obligations that benefit both the United States and Mexico."

"The United States looks forward to working alongside Mexico to fulfill these commitments so that we can stem the tide of illegal migration across our southern border and to make our border strong and secure," Pompeo said in a statement.

Download the NBC News app for breaking news and politics

Trump had been under intense pressure from business leaders and members of his own party to suspend the tariffs, which economists warned could have raised prices on thousands of goods imported from Mexico. Momentum had been growing among Republicans in the Senate to override any emergency declaration Trump might sign implementing the tariffs, which he said a few days ago would have grown every few weeks until they reached 25 percent.

Trump announced that he would impose the tariff last week, and that it would "gradually increase" until "Mexico substantially stops the illegal inflow of aliens coming through its territory."

The agreement came after the two sides met for a third straight day on Friday. An unexpectedly low growth in the May jobs numbers, announced Friday morning, may have increased pressure on the White House not to add any more hurdles to the economy.

A White House official told NBC News after negotiations Thursday that Mexico seemed willing to entertain a number of proposals that the White House had put on the table Wednesday.

Those proposals include putting 6,000 Mexican national guards at the border region with Guatemala and the possibility of a "safe third country" designation. That would include a provision requiring Central Americans to seek refuge in the first foreign country they enter.

The Washington Post reported that such a plan would mean the U.S. would deport Guatemalan asylum-seekers to Mexico, and Honduran and Salvadoran applicants to Guatemala.

Mexico had initially said a "safe third country" designation would be a red line.

In May, a federal appeals court ruled the Trump administration can make asylum seekers wait in Mexico for immigration court hearings while the policy is being challenged in court.

The administration announced the policy on Jan. 29 in San Diego and later expanded it to Calexico, California, and El Paso, Texas, the Associated Press reported. Under the policy, asylum seekers report to a border crossing the morning of their hearing. The U.S. government provides transportation to immigration court and returns them to the border afterward, according to the AP.

According to a White House official, negotiations were conducted between lawyers for both countries, including White House counsel Pat Cipollone.

Marc Short, chief of staff for Vice President Mike Pence, told Fox News that Cipollone was going "to try to hammer out some more details."

Short told reporters outside the White House that Mexico's first proposals on Wednesday had been "insufficient," but that the administration had been encouraged by how talks have proceeded since then.

The State Department said Friday evening that the U.S. and Mexico agreed that “in the event the measures adopted do not have the expected results, they will take further actions" and that discussions between the two countries would continue.

Senate Majority Leader Mitch McConnell, R-Kentucky, said "Mexico has a crucial role to play as a responsible neighbor."

"It is also good news for Kentuckians and for all Americans that U.S. families won’t be hit with the price increases that would have resulted from new tariffs on imports from Mexico," he said.

Senate Minority Leader Chuck Schumer, D-New York, seemed to mock Trump's announcement, tweeting: "This is an historic night!"

"Now that that problem is solved, I'm sure we won't be hearing any more about it in the future," he wrote.