Pakistani Prime Minister Imran Khan has said he will not allow the US to build military bases to strike the Taliban and other groups in neighbouring Afghanistan.
The cricketer-turned-politician said any such move would put Pakistan at risk of terrorist attacks.
In an opinion piece in The Washington Post this week, Mr Khan said Pakistan "simply cannot afford" the consequences of allowing the US to establish a presence in the South Asian nation.
"If Pakistan were to agree to host US bases from which to bomb Afghanistan and an Afghan civil war ensued, Pakistan would be targeted for revenge by terrorists again," Mr Khan wrote.
"We have already paid too heavy a price. Meanwhile, if the United States, with the most powerful military machine in history, couldn’t win the war from inside Afghanistan after 20 years, how would America do it from bases in our country?"
The Pentagon is scrambling to withdraw its forces from Afghanistan before a September 11 deadline set by US President Joe Biden, formally ending America's longest war.
US military chiefs have insisted they will continue to support the Afghan government and its security forces in an "over-the-horizon" capacity, meaning continued air and intelligence support from abroad as Washington attempts to maintain some sort of counter-terrorism effort in the landlocked nation.
In the years after the US-led invasion of Afghanistan in 2001, the Pentagon and the CIA maintained a low-key presence in Pakistan and operated drones from there, but the US presence dwindled after relations soured in 2011 following the killing of Osama bin Laden in Abbottabad and other incidents.
"US drone attacks, which I warned against, didn’t win the war, but they did create hatred for Americans, swelling the ranks of terrorist groups against both our countries," Mr Khan said.
Pakistan, he said, was ready to be a "partner for peace" in Afghanistan with the US.
"But as US troops withdraw, we will avoid risking further conflict.
"In the past, Pakistan made a mistake by choosing between warring Afghan parties, but we have learnt from that experience.
"We have no favourites and will work with any government that enjoys the confidence of the Afghan people. History proves that Afghanistan can never be controlled from the outside."