The decision turns American policy in the region on its head. Not only will it cut development and humanitarian assistance, but it will also halt joint law enforcement efforts, such as anti-gang units vetted by the United States, that had been supported by Republicans and the Trump administration until now, said Juan S. Gonzalez, a former deputy assistant secretary of state in the Obama administration.

Indeed, just a day before Mr. Trump made the comments, the United States signed a border security agreement with the three Central American governments intended to increase cooperation against human trafficking and organized crime.

Mr. Gonzalez said the aid withdrawal “undermines our interest,” adding that “we have actually had success against gangs in the United States by cooperating with regional law enforcement. It helped us prevent increased gang flow.”

The decision also caught Mexico off guard. The government there was already rattled on Friday by Mr. Trump’s threat to close parts or all of the border as early as next week in response to the immigration surge and this was an added blow.