The Afghan Taliban have freed two Western hostages in exchange for three imprisoned senior militants, officials and Taliban sources say.
American Kevin King and Australian Timothy Weeks were released three years after being kidnapped outside the American University of Afghanistan in Kabul where they worked as professors.
The three militants arrived in Qatar from Afghanistan as part of the swap.
Afghan officials say the deal is aimed at restarting talks with the Taliban.
President Ashraf Ghani said last week the decision was «a tough, but important» one and a «humanitarian gesture».
The swap includes Anas Haqqani, a leading figure and fund-raiser in the Haqqani militant group, and two other senior commanders, who had been held in prison by Afghan authorities.
Anas Haqqani’s older brother, Sirajuddin, leads the Haqqani network of fighters and is a deputy leader of the Taliban, which has a political office in Qatar.
It is unclear if they have been handed over yet to the Taliban.
The fate of 10 Afghan soldiers who the Taliban are reportedly to free as part of the deal is unclear, the New York Times reported.
What happened to the professors?
The two professors of English were ambushed by gunmen and taken from a vehicle while leaving their university campus in Kabul in August 2016.
US Navy Seals attempted a rescue mission several days later but Mr Weeks, originally from Wagga Wagga in Australia, and Mr King, from Pennsylvania, had been moved on just hours before.
The pair then appeared in a video, released in January 2017, appealing to then US President-elect Donald Trump to agree to a deal to secure their release.
On Tuesday, a Taliban source in southern Afghanistan told the BBC the pair had been handed over in the Nawbahar district of Zabul province at 10:00 local time (05:30 GMT).
According to a local police officer, who was involved in the swap, a 48-hour ceasefire was observed before the swap. The men were then flown away in a US helicopter.
The condition of the two men remains unclear, but in his speech last week Mr Ghani noted «their health has been deteriorating while in the custody of the terrorists».
The American University of Afghanistan said in a statement that it «shares the relief of the families of Kevin and Timothy, and we look forward to providing all the support we can» to the two men and their families.
Who are the Taliban prisoners?
Anas Haqqani, Haji Mali Khan and Hafiz Rashid were sent to Qatar as part of the exchange.
Haqqani is a leading figure in the Haqqani group, a militant group founded by his father Jalaluddin Haqqani, and now led by his older brother, Sirajuddin, who is also deputy leader of the Taliban, BBC Urdu’s Riffat Orakzai says.
Another four of his brothers been killed in various security operations in Pakistan and Afghanistan. The surviving family members are in hiding.
The Haqqani network has been behind many of the co-ordinated attacks on Afghan and Nato forces in recent years and has been blamed for some of the deadliest blasts in the country, including a truck bomb in Kabul in 2017 that killed more than 150 people.
Pakistan has been accused by the West of backing the Haqqani network to counter the influence of arch-rival India in Afghanistan, a charge it denies.
Anas was arrested in Bahrain in 2014. It is believed his captors, the Americans, kept him in a prison in the UAE for some time until he was handed over to the Afghan government in Kabul and imprisoned at Bagram air base.
Hafiz Rashid is a senior Taliban commander who was involved in equipping suicide bombers and helped choose their targets, according to The New York Times. His brother is a member of the Taliban negotiating team in Qatar.
Little is known about Haji Mali Khan, who is said to be a senior commander.
What impact could the exchange have?
It is hoped the exchange will boost efforts to re-start peace talks between the Taliban and the US.
The talks collapsed in September, after President Donald Trump had invited senior Taliban leaders and Afghan president Ashraf Ghani to meet at Camp David, near Washington DC, aiming to end the US’ longest war.
But a Taliban attack in the Afghan capital two days earlier, which killed a US soldier and 11 others, prompted Mr Trump to pull out, saying the group «probably don’t have the power to negotiate» if they were unable to agree to a ceasefire during talks.
Mr Ghani said in a televised speech that the exchange aimed to «facilitate direct peace negotiations.» However, the Taliban have long refused to negotiate with Mr Ghani’s administration, calling it a puppet of the US.