Turkey's defence ministry said Wednesday it had started pulling troops out of Afghanistan, apparently abandoning its plans to help secure Kabul's strategic airport.
"The Turkish Armed Forces are returning to our homeland with the pride of successfully fulfilling the tasks entrusted to it," the ministry said in a statement.
Turkey had more than 500 non-combat troops stationed in Afghanistan as part of NATO's now-abandoned mission in the war-torn country.
It had been negotiating with both the Taliban and Washington about playing a role in protecting the airport after the US troop withdrawal, which is scheduled to be completed on Tuesday.
US officials said those talks had been continuing last week.
But the Taliban's swift capture of the Afghan capital left Ankara's plans in disarray, eliminating a key point of leverage in its tumultuous relations with the United States.
Turkish President Recep Tayyip Erdogan said Ankara was still interested in playing a role in Afghanistan, keeping its lines of communication open with Taliban leaders.
"It is important for Afghanistan to stabilise," Turkish President Recep Tayyip Erdogan said as the troop withdrawal was announced.
"Turkey will continue to be in close dialogue with all parties in Afghanistan in line with this goal."
Erdogan has been under intense political pressure at home not to accept migrants that might come from Afghanistan in response to the fundamentalist Islamist group's rise.
Turkey became home to more than four million migrants -- most of them from Syria -- under a deal that helped stem the European Union's migrants crisis in 2016.
Ankara is building a wall along its eastern border to Iran to keep out Afghans trying to use the route to enter Europe.
Erdogan said Turkey was now home to roughly five million migrants of various status and could not accept any more.
"We cannot handle an additional burden of migration originating from Syria or Afghanistan," he said.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)