Lindsay Sandiford, 68, was arrested after arriving in Bali in 2012 when Indonesian authorities found cocaine worth €2.1 million in her suitcase.
A British drug-smuggling grandmother who has spent 12 years on death row in Indonesia will be sent home to the UK, the two countries announced on Tuesday.
Lindsay Sandiford, 68, has been imprisoned on Bali since 2012.
She was arrested at the resort island's airport after authorities found 3.8 kilogrammes of cocaine worth €2.1 million hidden in the lining of her suitcase. During the trial, Sandiford said she was forced to carry the drugs by a gang that threatened her children.
She was sentenced to die by firing squad and Indonesia’s highest court upheld it in 2013.
Another British prisoner, who has been serving a life sentence in Indonesia since 2014, will also be returned to the UK as part of an arrangement struck between the nations.
Shahab Shahabadi, 35, was arrested in Jakarta as a result of an investigation into an international drug trafficking network.
He had previously sent 30 kilogrammes of methamphetamine powder in several shipments from Iran to his partner for distribution in Jakarta, before finally arriving in Indonesia himself, prosecutors said.
The deal to repatriate the prisoners to serve out the rest of their sentences in the UK was signed by British Foreign Minister Yvette Cooper and Indonesia’s Senior Minister of Law Yusril Ihza Mahendra.
"Both of them [Sandiford and Shahabadi] are facing problems. The first one is ill and has been examined by a doctor from the British Consulate in Bali. She is seriously ill and is 68 years old," Cooper said.
Mahendra said Indonesia had agreed to release Sandiford on humanitarian grounds. The transfer of the prisoners will take place after both nations have completed technical and administrative steps, she said.
Indonesian President Prabowo Subianto's administration has sent several foreign prisoners home under bilateral agreements with their countries. They included a woman from the Philippines who faced the death penalty over drugs charges and five Australians convicted of heroin trafficking.
The United Nations says Indonesia is a major drug smuggling hub despite its extremely strict drug laws, in part because international syndicates target its young population.
About 530 people are on death row in Indonesia, mostly for drug-related crimes, including nearly 100 foreigners, government data showed last month.
Indonesia’s last executions, of a local citizen and three foreigners, were carried out in July 2016.