The Libyan Supreme Court has upheld the death sentences for six foreign medical workers imprisoned on disputed charges that they infected Libyan children with HIV. But there is still a chance they could be spared execution. The ruling has been greeted with dismay in Europe, where only a day earlier hopes had been raised that a deal was in the works to free them. VOA Correspondent Challiss McDonough reports from our Middle East bureau in Cairo.

Libya's Supreme Court rejected the medics' appeal and upheld the death penalty against five Bulgarian nurses and a Palestinian doctor. The case now moves onto the government-controlled High Judicial Council, which still has the power to commute the death sentences or pardon the medics. The Council will consider the matter on Monday.

Bulgarian and EU officials immediately condemned the Supreme Court ruling, a day after reports that a deal had been reached to free them.

Bulgarian President Georgi Parvanov called for a quick solution.

EU Commission President Jose Manuel Barroso told the European Parliament he remains hopeful that the medics will receive clemency.

"We regret that these decisions have been made, but I also want to express my confidence that a solution will be found," he said.

Late Tuesday, the non-profit Gaddafi Foundation, run by the son of Libya's leader, said a deal had been reached to free the health workers.

Intense behind-the-scenes negotiations have been aimed at securing their release. EU officials say the European Union has agreed to establish a fund to pay for the children's future medical care.

Libya considers the payments to the families to be compensation, but Bulgaria has rejected that term, saying it implies that the nurses are guilty. Bulgaria and the European Union are calling it humanitarian aid.

EU Justice Commissioner Franco Frattini said the ruling is likely to hurt recent efforts for European-Libyan cooperation on a number of issues, including migration.

"This decision taken by the supreme court does not encourage the EU to strengthen relations because frankly speaking, we have to react, from my point of view, negatively, totally negatively, to the fact that a group of European citizens are condemned to death, and they are not guilty from our point of view," he said.

The five Bulgarian nurses and a Palestinian doctor have been in Libyan prisons since 1999. Several of them have said they were tortured to extract confessions.

They were convicted of deliberately infecting 483 children with HIV, the virus that causes AIDS. Many international scientists and medical experts have testified that the first children were infected before the medics even arrived in Libya. They say the infections were really caused by negligence and poor hygiene procedures in the Benghazi hospital.

Bulgaria recently gave Bulgarian citizenship to the Palestinian doctor who is imprisoned alongside the Bulgarian nurses, to ensure that he is included in any deal to free them.