The French government believes the five Bulgarian nurses and a Palestinian doctor sentenced to death for infecting Libyan children with HIV can be saved.
Cecilia Sarkozy paid a surprise visit to the parties involved
An aide to French President Nicolas Sarkozy, Claude Gueant, told AFP the government was "reasonably optimistic".
Mr Gueant's statement came after he and Mr Sarkozy's wife, Cecilia, visited the medics, the families of the children, and the Libyan leader, Muammar Gaddafi.
On Wednesday, Libya's Supreme Court upheld the sentences imposed in 2004.
However, the death penalties will not be implemented unless they are approved by the country's High Judicial Council, which is due to meet on Monday.
The BBC's Rana Jawad says a financial settlement was recently reached with the families of the HIV-infected children, a deal which makes it is highly unlikely the death penalty verdicts will be enforced.
Mrs Sarkozy's visit came one day after the death sentences were handed down on the Bulgarian nurses and the Palestinian doctor, who recently acquired Bulgarian citizenship.
She said her visit was "not official" - she had been sent by the French president "as a mother" to affirm the support of France for the children.
In an interview with the AFP news agency after the trip, Mr Gueant said: "We can be reasonably optimistic."
TRIAL IN DATES
1999: 19 Bulgarian medics and a Palestinian doctor are arrested at a Benghazi hospital after an outbreak of HIV/Aids among children. 13 are later freed
May 2004: Libya convicts and sentences five Bulgarian nurses and the Palestinian doctor for infecting children with HIV. A Bulgarian doctor is freed
Dec 2005: Libyan Supreme Court overturns the convictions and orders a retrial
Dec 2006: Medics sentenced to death a second time
Feb 2007: Medics appeal to the Libyan Supreme Court
June 2007: Top EU officials hold talks in Libya to try to secure medics' release
11 July 2007: Libya's Supreme Court upholds death sentences
He said Col Gaddafi had also told them the families were ready to grant forgiveness.
"The nurses are also ready to meet a condition stipulated by Libya - not to engage in any additional appeal against Libya through international judicial proceedings."
The six medics have been in detention in Libya since 1999, when they were accused of having deliberately infected hundreds of children in the city of Benghazi with HIV-contaminated blood products.
They have consistently protested their innocence and have retracted confessions they say were made under torture.
Mrs Sarkozy met the medics in the prison where they are being held in Tripoli, and then flew to Benghazi to visit some of the HIV-infected children and their families.
A spokesman for the families, Idriss Lagha, welcomed the visit, describing it as warm and friendly.
Mr Lagha said they had discussed simplifying France's visa application process to allow the children to get treatment there.
She reportedly promised to raise their demands and hoped the entire case would end soon.
Mr Lagha also said the families were open to a settlement which would see the medics freed in accordance with what he called the Islamic principles of forgiveness and clemency.
"The world must show humanity towards our children, as we are doing towards the nurses. It must express a humane interest for our children, in ensuring their treatment for the rest of their lives."