Judges at the International Criminal Court have ruled that Libya is free to try Abdullah al-Senussi, the former Libyan spy chief who was a pivotal figure under Muammar Gaddafi.
The judges said that since Libya was able and willing to give Mr Senussi a fair trial on charges that were similar to the ICC's, there was no need to transfer him to the court's custody.
Mr Senussi's lawyers said they would appeal.
Mr Senussi and Gaddafi's son Saif al-Islam are accused of crimes against humanity during the uprising that toppled Gaddafi in 2011.
Both men are in detention in Libya while the ICC and Libya wrangle over who has the right to try them.
Mr Senussi's lawyer echoed many legal scholars in questioning whether Libya, whose prime minister was briefly seized by gunmen on Thursday, is in a position to administer a fair trial just two years after the end of Gaddafi's four-decade rule that has left the country divided and largely lawless.
"The country is sliding into wide-scale lawlessness where the law of the gun rules and armed militas do as they please," said Ben Emmerson, who is representing Mr Senussi before the ICC.
"The effect of this decision is to condemn Mr al-Senussi to face mob justice ... in which the inevitable outcome is the death penalty," he added.
Today’s ruling does not affect the case against Saif al-Islam, who is in custody in the western mountain city of Zintan.
Lawyers for both suspects have been trying to have them transferred to The Hague, where they would not face the death penalty.