“Frankly, Congress should actually fix the laws and we wouldn’t have this problem,” she said. “Mexico should engage with us and we wouldn’t have to take any additional steps.”

Mr. Trump’s abrupt decision could further complicate his ability to win a trade deal with other nations. Europe, Japan, China and other countries are contemplating entering into agreements with the United States and could view the move as a warning sign that Mr. Trump may not honor them and could impose tariffs over anything he deems problematic for the United States, including areas outside of trade policy.

“It’s hard to imagine every single country in the world is not paying attention to this,” said Jorge Guajardo, Mexico’s former ambassador to China and a former consul general of Mexico to the United States. The revised trade pact “was an example of how to reach an agreement with the United States, and it’s just been undone over something that has nothing to do with trade.”

Even some of Mr. Trump’s staunchest allies in Congress seemed perplexed by the move, though it was unclear whether they would take any action to stop it.

Senator Mitch McConnell of Kentucky, the majority leader, said that there was “a serious humanitarian crisis” at the southwestern border but added that a healthy economic relationship with Mexico was vital to American prosperity. “Any proposal that impacts this relationship deserves serious examination,” he said.