Libya's supreme court has overturned death sentences on six foreign health workers who had been convicted of infecting Libyan children with HIV.
Relatives of the children want the death penalty upheld
It has also ordered a retrial of the five Bulgarian nurses and a Palestinian doctor in a lower court.
The six were sentenced to death in May 2004 for infecting 426 children with the HIV virus in the city of Benghazi.
They have always maintained their innocence. Bulgaria, the US and EU welcomed the decision.
"The unfair death sentences were reversed.... We hope that the swiftness and the effectiveness demonstrated by the Libyan court in the past days will help to solve the case as soon as possible," Bulgarian President Georgi Parvanov said.
US state department spokesman Justin Higgins described the decision as positive.
"We believe a way should be found to allow the medics to return to Bulgaria and Palestine," he said, the Reuters news agency reported.
Emma Udwin, the European Commission's external relations spokeswoman, expressed the hope that the move would "lead to a rapid and fair settlement to all concerned".
The medics, who have spent almost seven years in prison, say they were made scapegoats for poor hospital hygiene.
The BBC's Bethany Bell in the Egyptian capital Cairo says the decision to order a retrial appears to be an attempt to end the stand-off between Libya and the West.
Supporters of the medics are angry that they are still in jail
The six were condemned to face death by firing squad after they were found guilty of knowingly infecting the children with the HIV virus. About 50 of the children have since died.
The supreme court ordered the retrial after hearing an appeal by the health workers, who said their confessions were extracted under torture.
The medics also presented the testimony of Western medical experts, who said the outbreak started before they arrived and was probably caused by unhygienic practices.
Parents and relatives of the infected children stood outside the supreme court, protesting against the decision and calling for the death penalty to be carried out.
The verdict comes at a time when negotiations on financial compensation have been taking place between the families of the infected children, a Bulgarian NGO and the EU.
On Friday, Bulgaria and Libya agreed to set up a fund for the families of the 426 HIV-infected children.