Pakistan has long posed a dilemma for the United States — should America provide it with aid and treat it as an ally because of its potential to help fight regional extremists, or should ties and funding be restricted, or even severed, because of its connections to those groups?

The Trump administration’s announcement on Thursday that it would freeze nearly all military aid to Pakistan, roughly $1.3 billion annually, is the latest of several times in the last 16 years that funding has been withheld or modified out of American frustration with Pakistan’s support for certain terrorist groups. But President Trump’s bombast and the precipitous way the decision seems to have been made have led to doubts that Mr. Trump has a serious plan for managing the ramifications of this move.

Almost every military flight into Afghanistan goes through Pakistani airspace. Most supplies travel along Pakistani roads and rails. Pakistan could shut down American access at any moment, and some Pakistani officials are threatening to do just that. Pakistan could also ally more closely with China, which is already investing in major new infrastructure projects and expanding its international leadership at America’s expense, and be more hard-line in its rivalry with India. Indeed, China could once again be the beneficiary of a Trump decision estranging the United States from longtime partners.

The president is good at venting grievances, as he demonstrated in his New Year’s Day tweet on the situation: “The United States has foolishly given Pakistan more than 33 billion dollars in aid over the last 15 years,” he wrote, “and they have given us nothing but lies & deceit, thinking of our leaders as fools. They give safe haven to the terrorists we hunt in Afghanistan, with little help. No more!”