Turkey is hammering out a deal with the US to take over security operations at Kabul’s civilian airport, offering the Nato partners a rare chance for co-operation after a series of disputes have chilled relations.

The US this week left its main military base in Afghanistan, part of an accelerated withdrawal that has led to a resurgent Taliban gaining ground and concerns that the country could descend into chaos.

President Recep Tayyip Erdogan told Joe Biden at last month’s Nato summit that Turkey could run security at the airport if the US president provided it with the “diplomatic, logistical and financial support” required for the mission. Erdogan also acknowledged “the reality of the Taliban”, saying Ankara would continue talks with the militants.

Hulusi Akar, the Turkish defence minister, and US defence secretary Lloyd Austin had a “constructive and positive” phone conversation on Wednesday on “the secure operation of the Hamid Karzai International Airport”, the Turkish defence ministry said, adding that they would talk again on Thursday.

Akar said this week that Turkey was determined to make “contributions for the security, peace and welfare of the Afghan people”, according to state broadcaster TRT.

Yet far more hinges on Turkey reaching an accord with the Taliban, which is steadily advancing towards the capital and has made clear it will not tolerate any foreign forces on Afghan soil after the US leaves, said Hikmet Cetin, a former Turkish foreign minister who has served as Nato’s senior civilian representative in Afghanistan.

“Afghanistan is now in the midst of a de facto civil war. Turkey needs a ceasefire and a deal with the Taliban, which is now telling it: ‘You came with Nato, and you’ll leave with Nato’,” he said. “Without the Taliban’s approval, Turkey assuming this role is a mistake. It’s too risky.”

Keeping Hamid Karzai International airport open as a secure gateway is crucial if embassies and humanitarian aid organisations are to remain in Afghanistan. “We are aware that the Kabul airport must remain open and operating. If it’s not, embassies will withdraw, turning Afghanistan into an isolated state,” Akar said.

Turkey, Nato’s second-biggest army, already runs military operations at the airport. Akar has ruled out increasing the 500-strong battalion, and Erdogan has said he hopes to recruit both Hungary and Pakistan to the mission. Pakistan has already refused to allow the US to stage air attacks from its soil. Pakistan expects Turkey to seek “logistical support and passage” through the country and “intelligence sharing on Afghanistan”, a senior Pakistani government official told the Financial Times on condition of anonymity.

Rahimullah Yusufzai, a longtime Afghanistan watcher based in Peshawar, the frontier town along the Afghan border, said Pakistan’s involvement will inflame tensions with the current Afghan government, which sees Islamabad as the Taliban’s main backer. “The best Pakistan can do is informally support Turkey. Beyond that I think is not in Pakistan’s interest,” he said.

Turkey, which has backed the US in a non-combat role since the war began in 2001, shares religious and other ties with Afghanistan. Erdogan also sees the initiative as a chance to “recalibrate relations” with the US after years of estrangement over divergent foreign policies, said Hasan Selim Ozertem, an independent security analyst.

“Turkey believes this step can show it remains an indispensable Nato partner, a reminder that it can work with the US, that it is one of the few countries that can take on such a responsibility,” he said.

Since Biden’s election, Erdogan has pledged to mend ties with the US, which has put sanctions on Ankara over its purchase of an advanced Russian missile system designed to shoot down Nato jets. A deal over Afghanistan “puts them [the disputes] in deep freeze and gives the sides a positive agenda to focus on,” said Ozertem. US government officials declined to comment on their progress towards a deal with Turkey.

Additional reporting by Stephanie Findlay in New Delhi and Aime Williams in Washington