ISLAMABAD (AP) — United States and Pakistani officials are meeting Friday amid a worsening relationship between the two countries as each nation searches for a way forward in Afghanistan under Taliban rule.

Pakistan has been pressing for greater engagement with the all-male, all-Taliban Cabinet in Kabul even as it shies away from any unilateral formal recognition. The South Asian country has urged Washington to release billions of dollars to the Taliban so that Afghanistan’s new rulers can pay salaries of the many ministries and avoid an economic meltdown. The United Nations High Commissioner for Refugees warns such a crash could unleash a mass migration.

Washington, which spent the better part of two years negotiating peace with the Taliban, is still smarting from its chaotic end to 20 years in Afghanistan and much about the aftermath remains unclear. The U.S. is quietly talking to some Taliban to evacuate American nationals and others. Meanwhile, Republican senators introduced legislation that would sanction Afghanistan’s new rulers. Images of desperate men, mostly Afghans, running alongside departing American C-17 and falling from the wheel well have come to represent the mayhem of the U.S. withdrawal.

The new legislation introduced late last month by 22 Republican senators also calls for sanctions on Pakistan for providing safe haven for Taliban. That’s raised hackles among Pakistani rulers, who have slammed Washington for seeking and getting Islamabad’s help to talk peace with the Taliban – even as the U.S. blames Pakistan for its loss in Afghanistan.

U.S. Deputy Secretary of State Wendy Sherman is meeting with the country’s powerful army chief, Gen. Qamar Javed Bajwa, considered the leading architect of Pakistan’s Afghan strategy while Pakistan’s Foreign Ministry wages the diplomatic battle. Sherman also is meeting with Foreign Minister Shah Mahmood Qureshi as well as Prime Minister Imran Khan.

“Close and regular engagement between Pakistan and the United States has always been mutually beneficial and effective for stability in South Asia,” Pakistan’s Foreign Ministry spokesman Asim Iftikhar told reporters on Thursday in the capital, Islamabad.

Sherman met the Security Adviser Moeed Yusuf late on Tuesday but neither side revealed information on the substance of the talks other than a vague reference to “developments in Afghanistan and ways to advance cooperation across the bilateral relationship. “

Pakistan walks a fine line as it seeks to establish a relationship with the United States in a changing region, where both Russia and China have increasing influence and the Taliban now rule in Afghanistan.

A strident opponent of the U.S.-led so-called “war on terror,” Khan has assured Pakistanis that Washington would have no access to Pakistani territory to launch so-called “over-the-horizon” attacks on Afghanistan.

The Pentagon has warned that Afghanistan could be a threat in one to two years. The greatest threat would seem to be from the Islamic State, which are also Taliban enemies. They have ramped up their attacks on the Taliban in recent weeks, even carrying out a bombing in the capital as Taliban spokesman Zabihullah Mujahid conducted a memorial service for his mother.

But Pakistan faces strong opposition among its 220 million people to any accommodation to Washington to attack Afghanistan.

A Gallup Pakistan Poll released late Thursday showed that 55% of Pakistanis favored an Islamic government akin to the one operated by the Taliban in Afghanistan.

The survey conducted between Aug. 13 and Sept. 5 polled 2,170 men and women in cities and in rural areas. The error margin is between 2% and 3%.

Copyright © The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.