Pakistan denounced Washington's decision to suspend hundreds of millions of dollars in security assistance as "counterproductive" Friday, in a carefully-worded response to the frustrated Trump administration's public rebuke over militant safe havens.
The United States has been threatening for months to cut aid to Islamabad over its failure to crack down on groups such as the Afghan Taliban and the Haqqani network, which it says operates from bases in Pakistan's northwest.
The rhetoric has raised hackles in Islamabad and fears the row could undermine Pakistan's support for US operations in Afghanistan.
On Thursday, the State Department announced a dramatic freeze in deliveries of military equipment and security funding until Pakistan cracks down on the militants.
The announcement ignited some small protests in Pakistan on Friday, including in Chaman, one of the two main crossings on the border with Afghanistan where several hundred people gathered to chant anti-US slogans.
"We don't need any type of aid. Almighty Allah is with us and he is giving us everything," protester Mohammad Saleem told AFP, adding that he had a message for Donald Trump: "Don't threaten us."
But Pakistan's foreign ministry issued a cautious statement in which it said it was "engaged" with US officials and awaiting further details.
Without referring to the decision directly, it warned that "arbitrary deadlines, unilateral pronouncements and shifting goalposts are counterproductive in addressing common threats."
Emerging threats such as the growing presence of the Islamic State group in the region make cooperation more important than ever, it added.
Pakistan has fought fierce campaigns against homegrown Islamist groups, and says it has lost thousands of lives and spent billions of dollars in its long war on extremism.
But US officials accuse Islamabad of ignoring or even collaborating with groups that attack Afghanistan from safe havens along the border between the two countries.
In September last year, the US suspended $255 million in funding to help Pakistan buy high-tech weaponry from American manufacturers.
Now, the Defense Department has been instructed to stop making payments from "coalition support funds" set aside to refund Pakistani spending on counter-terrorist operations.
There will be exemptions, and officials refused to put a figure on how much Pakistan will lose out on if it fails to cooperate.
But the National Defense Authorization Act permits the US military to spend up to $900 million in the 2017 financial year and $700 million in financial 2018.
State Department spokeswoman Heather Nauert said the security spending would be suspended until Pakistan takes "decisive action" against the Afghan Taliban and the Haqqani network.
The move, which US officials had hinted at for months, was greeted optimistically in Afghanistan.
"We have been saying for years that neighbouring Pakistan is providing safe haven to terrorist groups, and they were also funding the terrorist groups," Nasrat Rahim, deputy interior ministry spokesman, told reporters in Kabul.
"We welcome this announcement."
Privately, US diplomats insist the relationship is not in crisis.
They say Pakistan is not refusing to fight the Haqqani network, but that the two capitals disagree about the facts on the ground.
Pakistan insists safe havens have been eradicated, but US intelligence says it is still seeing militants operating freely.
Nauert was at pains to point out that the frozen funds had not been cancelled, and would be ready to be disbursed if Pakistan takes action to prove its commitment to the fight.
"The United States stands ready to work with Pakistan in combating all terrorists, without distinction," Nauert said.
On Thursday, the US State Department also tweeted that it has placed deeply conservative Muslim Pakistan on a special watch list for severe violations of religious freedom.
Pakistan, whose religious minorities have long been marginalised and targeted, has not responded to the move.