President Trump and his allies on Sunday declared victory in the tariffs standoff with Mexico after the administration appeared to have secured significant commitments from the Mexican government to stem the flow of Central American migrants at the U.S. border.

The agreement gave Trump fresh ammunition against his critics, who have pointed out that his controversial negotiating tactics have yielded far fewer results than promised on multiple issues during his time in office.

Whether the deal will greatly reduce the number of migrants entering the United States remains to be seen. But it nonetheless represents a serious effort by Mexico to do more on an issue central to Trump’s reelection campaign after he threatened to impose a 5 percent across-the-board tariff on one of the United States’ top trading partners.

Mexico announced Friday night that it would implement “strong measures” to reduce the flow of migrants across its territory toward the southern U.S. border, including the unprecedented deployment of thousands of Mexican national guard troops. It also agreed to expand a program allowing Central American migrants to stay in Mexico while they await the adjudication of their asylum claims.

“The president put a charge in his whole dialogue with Mexico with the tariff threats, brought them to the table,” Acting Homeland Security Secretary Kevin McAleenan said in an interview on “Fox News Sunday.” “The foreign minister of Mexico arrived within hours. He arrived the next day with real proposals on the table. This is the first time we’ve heard anything like this kind of number of law enforcement being deployed in Mexico to address migrations.”

With arrests at the U.S.-Mexico border soaring and Trump lashing out — at Democrats, foreign governments and U.S. laws — Homeland Security officials are under enormous pressure to halt the migration boom. The Trump administration’s efforts to deter migration have not worked, either being shot down in the courts or failing to get through Congress. And Mexican officials brushed off some of the president’s earlier demands.

Trump’s threat to impose tariffs on Mexico to gain leverage in immigration negotiations drew criticism from lawmakers in both parties, who called it a dangerous escalation that could damage the U.S. economy.

But in some morning tweets, Trump said that Mexico “was not being cooperative on the Border” before the deal reached Friday. Now, he said, “I have full confidence, especially after speaking to their President yesterday, that they will be very cooperative and want to get the job properly done.”

Trump said he could move to reimpose tariffs if Mexico doesn’t follow through on its promises. Some aspects of the deal, he added, remain to be announced — “one in particular,” he said, “will be announced at the appropriate time.”

In a tweet Monday morning, Trump said the change would require “a vote by Mexico’s Legislative body!”

“We do not anticipate a problem with the vote but, if for any reason the approval is not forthcoming, Tariffs will be reinstated!” he said.

The president’s tweets seemed to hint at a possible component of the deal that would transform asylum rules across the region and make applicants seek refuge in the first country they reach. Such an accord would allow the United States to deport most asylum seekers from Guatemala to Mexico, and those from Honduras and El Salvador would be flown to Guatemala.

Homeland Security officials think such an arrangement would lead to a dramatic drop in migrants arriving each month at the U.S. border. Those migrants are generally released from custody if they have a child with them.

Democrats criticized the agreement as more evidence of the president’s anti-immigration agenda while questioning how much impact it would have.

“These are agreements that Mexico had already made, in some cases months ago,” former congressman Beto O’Rourke, who is running for president, said in an interview on ABC’s “This Week.” “They might have accelerated the timetable, but by and large the president achieved nothing except to jeopardize the most important trading relationship that the United States of America has.”

Immigrant rights advocates argued Sunday that while it was important that the United States and Mexico pledged to invest resources in Central America, the deal fails to address the root cause of the problem, which is poverty and violence in the region that the migrants are fleeing.

“In general, I don’t think that this agreement stems the flow,” Ali Noorani, executive director of the National Immigration Forum, said in an interview. “The situation in Central America is pretty dire. There are no examples in modern history of us being able to enforce our way out of a migration crisis like this.”

But those who support a harder line on immigration said the agreement was a positive sign.

“I think Mexico sees that our two countries have a shared interest in clamping down on this,” said Mark Krikorian, executive director of the Center for Immigration Studies, a think tank that favors restricted immigration. “We’ll see in a couple of months whether it makes a difference, but I think it can. I’m cautiously optimistic.”

Homeland Security officials say the deal, if fully implemented, represents a breakthrough in their pressure campaign to get Mexican President Andrés Manuel López Obrador to take a more robust enforcement approach.

In particular, the pledge to deploy 6,000 national guard forces in southern Mexico could make it more difficult for smugglers to continue transporting groups of Central American migrants on buses with little interference from authorities.

Mexico has also given assurances it will expand immigration detention centers and bolster deportation efforts.

The newly formed national guard was created by López Obrador primarily in response to domestic pressure to reduce crime and Mexico’s soaring homicide rate, so committing those forces to immigration enforcement — which López Obrador described last year during his campaign as doing “dirty work” for the United States — amounts to a significant concession, and has generated criticism.

Mexico had already promised to use the national guard, but the deployment size is much larger than what the government had offered previously.

U.S. officials also view the full expansion of the MPP program, known informally as “Remain in Mexico,” as a difference-maker, allowing them to potentially require thousands more asylum seekers to wait outside U.S. territory while their claims for protection are fully adjudicated, a process that can take years. Mexico to date has been resisting U.S. efforts to expand the program across the entire border.

The MPP program has so far survived court challenges, but a panel of federal judges in California has raised doubts about its legality, and Homeland Security officials have been bracing for an injunction that could halt the program.

For U.S. officials, the question is whether the agreement will bring the rapid reduction in unauthorized border crossings that Trump is demanding, and whether it will be sustained once the president’s threats abate.

Over the weekend, the deal prompted congressional Republicans to call for action on the United States-Mexico-Canada Agreement, Trump’s new North American trade deal, which has yet to be approved by Congress.

Sen. Rob Portman (R-Ohio), a Senate Finance Committee member and former U.S. trade representative, said in a statement Friday that he hoped the migration accord would “pave the way for the House and Senate to move quickly to pass the U.S.-Mexico-Canada Trade Agreement.”

The White House took a step this month to begin the process of congressional approval, but House Speaker Nancy Pelosi (D-Calif.) warned as recently as Wednesday that approval was in doubt in the House unless several concerns about the negotiated agreement are addressed.

“We hope to have a path to yes to get it done,” she told reporters. “But you have to have enforcement as part of the agreement, not as part of a sidebar letter or bills that we might pass in each country — part of the agreement.”

A senior Democratic aide, who spoke on the condition of anonymity to describe internal conversations, said Sunday that the migration deal was “totally irrelevant” to leaders’ concerns about the USMCA.

Republican lawmakers, meanwhile, appeared relieved in talk-show appearances Sunday.

Sen. Roy Blunt (R-Mo.), who had spoken out against Trump’s tariff threats, called the deal “a big win for both sides” and said it sent a message to China, whose leaders are wrangling with Trump over trade.

“Even though I’m not a big supporter of tariffs, he is, and his willingness to use that probably helped produce a result,” Blunt said on “Face the Nation.” “I hope we don’t have to go back to that as an issue again with Mexico.”

With an apparently successful outcome in hand, Trump still couldn’t avoid overselling the deal. In a tweet Saturday morning, the president claimed that Mexico had agreed to “IMMEDIATELY BEGIN BUYING LARGE QUANTITIES OF AGRICULTURAL PRODUCT FROM OUR GREAT PATRIOT FARMERS!”

But Mexico’s ambassador to the United States, Martha Bárcena, declined to confirm that account. In an interview on CBS’s “Face the Nation,” she said only that agricultural trade “is going to grow without tariffs and with USMCA ratification.”

“But there was no transaction that was signed off on as part of this deal, is what I understand you’re saying,” host Margaret Brennan asked. “You’re just talking about trade.”

Bárcena nodded a few times before answering. “I’m talking about trade, and I am absolutely certain that the trade in agricultural goods would increase dramatically in the next few months,” she said.

Later, in a tweet, Bárcena maintained that she “did not contradict” Trump on the issue — underscoring Mexican officials’ hesitance to appear critical of the president so soon after avoiding a major trade war.

Juliet Eilperin and John Wagner contributed to this report.