Once they had been some of the most powerful men in Libya, with the power of life and death over their fellow citizens.
Now they just looked old and diminished, and some looked ill. One former minister (he was later found not guilty) seemed to be suffering from advanced senility.
The most powerful of them all, Saif al-Islam Gaddafi, was absent, as he had been for the entire trial. Col Gaddafi's son was locked in a prison nearly a 100 miles away.
It was hard to think that these men once inspired such terror. None of them seemed cocky or aggressive as they waited to hear what their punishment would be.
They sat quietly, some making nervous movements of their hands, one or two grasping the bars of the cage, others playing with imaginary worry-beads. One kept his eyes shut, moving gently backwards and forwards, muttering to himself.
When the sentences were read out, though, their faces didn't register much emotion - though one man winced as he heard what would happen to him:  life imprisonment.
One prisoner, overweight and tough-looking, suddenly collapsed. Leaning against the man next to him, his face turned a blueish-grey and his eyes sightless. It looked like a stroke or a heart-attack, but it turned out to be a powerful asthma attack brought on by the stress of the sentencing.
The presiding judge rarely glanced at the men in the dock; he must have seen them all so often during the past three years. He ran through the long list quickly and fluently.
Even when the lights went out - in Tripoli, the electricity supply is constantly being cut - he continued reading aloud with scarcely a beat missed, using the emergency red lights around his microphone.
No one could forget, though, that the star of the show was missing.  Saif al-Islam Gaddafi's sentence - death by shooting - was the first to be announced, and a little quiver ran around the court-room as it was. He may have been watching the proceedings in his prison in the centre of Zintan, in the western mountains. If so, he won't have been surprised.
By the last years of the Gaddafi regime Saif al-Islam was deeply loathed in Libya, even while politicians in Britain, France and Italy were behaving as though he was a close friend. His dubious PhD from the London School of Economics was regarded in Tripoli with scorn.
Yet he continued to lecture the nation on television, much as he lectured anyone who - like me - interviewed him, waving his forefinger in everyone's face.
At first, when the men from the Zintan group captured Saif al-Islam Gaddafi after the fall of his father in 2011, some of them treated him brutally.
They chopped off the admonitory forefinger, and, cradling his hand in a bloodstained handkerchief, he pretended his hand had been injured in a Western air strike.
A year or so later, some of his self-confidence had returned.  In 2013, when I went to Zintan to watch him make an appearance in court, he greeted me with a little of the old cheerfulness, glad perhaps to have a television camera to play up to again.
Is he now in danger of execution? His lawyers will no doubt appeal against his sentence, as those representing most or all of the other eight people condemned to death will do.
But Saif al-Islam's best protection is probably the fact that he's being held in Zintan. He's hated there as much as anywhere - the incident of the forefinger shows that - but the huge antagonism which exists between the Zintan group and the Tripoli government makes it highly unlikely that the Zintanis will hand him over now.
The relationship between Zintan and the predominantly Muslim Brotherhood government in Tripoli is so bitter that it will probably be the greatest factor in deciding Saif al-Islam's fate.
Was his trial, and that of the other members of the Gaddafi regime, a fair one? It was certainly more than a little chaotic, but that is only to be expected. To an outsider, it doesn't look like victors' revenge: the results are much more considered and varied than that. Four defendants were acquitted, including a former foreign minister.
The view of the International Criminal Court is that The Hague is the proper place to hold trials like this. Most Libyans would probably say that it's essential for them as a nation to sort out their own problems, by themselves.
What eventually happens to Saif al-Islam Gaddafi and the others sentenced to death will colour the way the outside world regards Libya in future. Life imprisonment will scarcely get any attention internationally; execution will attract the kind of criticism that Libya could well do without.
The accused men sat behind the bars of their cage in blue prison-issue pyjamas, their heads close-cropped.