President Trump’s use of tariff threats against Mexico to induce concessions on migration policy was a counterproductive exercise in “threats and temper tantrums,” according to House Speaker Nancy Pelosi.

“President Trump undermined America’s preeminent leadership role in the world by recklessly threatening to impose tariffs on our close friend and neighbor to the south,” Pelosi, a California Democrat, said Saturday morning. “Threats and temper tantrums are no way to negotiate foreign policy.”

The tariffs, a 5% tax on all goods imported from Mexico, were scheduled to take effect on Monday. Trump issued the threat as the Department of Homeland Security projected that more than 1 million people would be apprehended this year in illegal attempts to cross the southwest border.

“We would like to thank Mexican Foreign Minister Marcelo Ebrard for his hard work to negotiate a set of joint obligations that benefit both the United States and Mexico,” Secretary of State Mike Pompeo said Friday night. “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.”

The agreement calls for Mexico to “take unprecedented steps” to stop Central American migrants from entering the country on their way north to the United States, “to include the deployment of its National Guard throughout Mexico, giving priority to its southern border,” according to the State Department. Mexican officials also agreed that migrants who reach the United States and request asylum “will be rapidly returned to Mexico” while U.S. officials review the petition.

Pelosi said she was “deeply disappointed” by the asylum provisions of the deal, which she claimed “violates the rights of asylum seekers under U.S. law and fails to address the root causes of Central American migration.”

Trump predicted Friday evening that the deal would “greatly reduce, or eliminate, Illegal Immigration coming from Mexico,” but that claim drew scorn from Senate Minority Leader Chuck Schumer. “Now that that problem is solved, I’m sure we won't be hearing any more about it in the future,” the New York Democrat replied Friday.