The Afghan Taliban have freed two Western academics held hostage since 2016 in exchange for three imprisoned senior militants.
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.
The Taliban also announced they had released 10 captured Afghan National Security Force members, saying the prisoner exchange had been "successfully executed".
"These actions are a step forward in good-will and confidence building measures that can aid the peace process," the group said in a statement.
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.
A risky move – or political savvy?
Analysis by Auliya Atrafi, BBC Afghan, Kabul
This is a huge gamble for President Ghani.
The image of Anas Haqqani has been used by critics of the government and civil society protesters to represent the most extreme part of the Taliban – tRead More – Source