Scientists have cast doubt on charges that five Bulgarian nurses and a Palestinian doctor deliberately infected Libyan children with HIV.
The medics were arrested in 1999
The medics could face the death penalty if found guilty by a court in Tripoli later this month.
An international team analysed samples taken from the infected patients.
Writing in Nature, they said their work showed the HIV subtype involved began infecting patients in Libya well before the medical workers arrived in 1998.
An initial trial condemned the medics to death in 2004, but the Libyan Supreme Court overturned the verdicts, and ordered a retrial.
The defendants are accused of knowingly infecting more than 400 children with HIV in the eastern town of Benghazi.
The medics say that they were tortured into giving false confessions.
The first trial lasted almost six years, and the medics have been in jail since 1999.
They say the children were infected through poor hygiene - and a body of scientific work supports their claims.
History of outbreak
The researchers worked on blood samples collected by a network of European clinical research centres that are involved in treating the infected children.
By analysing mutations in the genetic material of the HIV virus found in the samples they were able to reconstruct the history of the outbreak.
In a statment, researchers Dr Tulio de Oliveira and Dr Oliver Pybus, from Oxford University, said: "All the lines of scientific evidence point in the same direction, towards a long standing infection control problem at the hospital, dating back to the mid 1990s or earlier."
Dr Thomas Leitner, of Los Alamos National Laboratory, has provided forensic evidence in many HIV cases.
Writing in Nature, he said the latest research was "compelling evidence that the outbreak had started before the accused could have started it."
There has been mounting international pressure on Libya to hear independent scientific evidence.
International experts say the scientific report used in the trial was nothing but 'conjecture' and 'supposition'.
Last month 114 Nobel Laureates wrote an open letter to Colonel Gaddafi urging the appropriate authorities to hear independent science-based evidence, and reaffirming the need for a fair trial.