The spectacle, aired live on state television, was a stunning moment for Egyptians. Many savored the humiliation of the man who ruled with unquestionable power for 29 years, during which opponents were tortured, corruption was rife, poverty spread and political life was stifled.
After widespread skepticism that Egypt's military rulers would allow one of their own - a former head of the air force - to be prosecuted in front of the world, the scene went a long way to satisfy one of the key demands that has united protesters since Feb. 11, when Mubarak fell following an 18-day uprising.
"This is the dream of Egyptians, to see him like this, humiliated like he humiliated them for the last 30 years," said Ghada Ali, the mother of a 17-year old girl in the city of Alexandria who was shot to death during the crackdown.
"I want to see their heart explode like my daughter's heart exploded from their single bullet," Ali told The Associated Press, breaking down in sobs.
It was the first time Egyptians have seen Mubarak since Feb. 10, when he gave a defiant TV address refusing to resign.
In the courtroom, a prosecutor read the charges against Mubarak - that he was an accomplice along with his then-interior minister in the "intentional and premeditated murder of peaceful protesters" and that he and his sons received gifts from a prominent businessman in return for guaranteeing him a lowered price in a land deal with the state.
"Yes, I am here," Mubarak said from his bed, raising his hand slightly when the judge asked him to identify himself and enter a plea. "I deny all these accusations completely," he said into a microphone, wagging his finger. His sons also pleaded not guilty.
The emotions swirling around the trial were on display outside the heavily secured Cairo police academy where the trial was held.
A crowd of Mubarak supporters and hundreds of relatives of slain protesters and other Mubarak opponents massed at the gates, scuffling sporadically as they watched the proceedings on a giant screen. They threw stones and bottles at each other while riot police with shields and helmets tried to keep them apart. Officials said 53 people were hurt, most lightly.
About 50 supporters pounded on the steel gate trying to get into the compound, chanting "We Love you, Mubarak!" until police charged at the with electrified batons and dispersed them. "We will demolish and burn the prison if they convict Mubarak," they screamed. Some of the supporters had bandaged heads from beatings, and many wore t-shirts with the slogan, "I am Egyptian and I reject the insulting of our leader."
But the father of a slain protester, among those sweltering in the heat outside on the third day of fasting in the Muslim month of Ramadan, was ecstatic. "We are here to tell Hosni, 'Happy Ramadan, congratulations on your new cage,"' Mohammed Mustafa el-Aqad said.
Wednesday's court session was largely taken up by procedural measures as lawyers from both sides filed motions.
But no matter how dry the action, the sight of Egypt's one-time most powerful man inside the defendants' cage, made of iron bars and metal mesh was riveting. Defendants are traditionally held in cages during trials in Egypt.
Mubarak was flown in just before the session from Sharm el-Sheikh, the Red Sea resort where he has been under arrest at a hospital since April. A sheet pulled up to his chest, he was wheeled into the defendants cage on a hospital bed at the session's start. After weeks of reports from Sharm that he was in a coma, unable to speak and refusing to eat, he looked less frail than many had imagined he might. Though he was pale and his eyes were ringed with red, his hair was dyed black, he was awake, alert and even had a moment of his characteristic defiance, wagging his finger as he denied the charges.
With him in the cage were his nine co-defendants, including his two sons - one-time heir apparent Gamal and wealthy businessman Alaa - his former interior minister Habib el-Adly, and six top former police officials.
From time to time, Mubarak craned his head to see the proceedings. Other times, he crooked his elbow over his face as if in exhaustion. While the other defendants sat on wooden benches in the cage, the 47-year-old Gamal and 49-year-old Alaa in their white prison uniforms stood next to their father's bed, at one point with their arms crossed on their chest seemingly trying to block the court camera's view of their father. The two sons each carried a copy of the Quran and leaned over to talk to their father.
Relatives of the defendants sat near the cage. A fence running through the middle of the chamber divided them from the rest of the audience of around 300 people, including a few relatives of protesters killed in the uprising, kept far enough that they cannot shout or throw anything at the former leader.
During the session, Mubarak's lawyer filed a motion that Defense Minister Hussein Tantawi - the head of the council of generals that now runs Egypt - be called to testify in the trial. He argued that Tantawi was in control of security after Jan. 28, three days into the protests. The motion signals an attempt by the defense to drag the military into the case.
After several hours, the judge adjourned Mubarak and his sons' trial until Aug. 15, though hearings in el-Adly's case would continue Thursday. The judge ordered Mubarak held at the International Medical Center, a military hospital on the outskirts of Cairo, and that an oncologist be among the doctors monitoring him. That was one of the strongest indications yet that the 83-year-old Mubarak has cancer after months of unconfirmed reports.
Up to the last minute, many Egyptians had doubted that Mubarak would actually appear at the trial, expecting health issues would be used as an excuse for him to stay away.
His healthier than expected appearance could raise demands that he be held in prison like his sons rather than "in the cushy hospital," the anti-Mubarak activist group "We are all Khaled Said" wrote in a posting on its Facebook page. The group is named after a young man killed by police in 2009.
Mostafa el-Naggar, one of the leading youth activists who organized the anti-Mubarak uprising, called the scene of the trial "a moment no Egyptian ever thought was possible."
"I have many feelings. I am happy, satisfied. I feel this a real success for the revolution, and I feel that the moment of real retribution is near," he told The Associated Press.
The trial came only after heavy pressure by activists on the now ruling military - one of the few demands that still unites the disparate protest movement. It answers, at least partially, a growing clamor in Egypt for justice not only for the wrongs of Mubarak's authoritarian regime but also for the violent suppression of the largely peaceful uprising, in which 850 protesters were killed.
In February, as protests raged around him, Mubarak vowed he would die on Egyptian soil. The last time Egyptians saw him, he appeared on state TV, handing most of his powers to his vice president but refusing to resign. He proclaimed he was "adamant to continue to shoulder my responsibility."
The next day, his resignation was announced and Mubarak fled to a palatial residence in Sharm el-Sheikh. The ruling generals who took power from him - and who were all appointed by Mubarak before the uprising - appeared reluctant to prosecute him, but protests flared anew, pressuring action.
In April, Mubarak was moved to the Sharm el-Sheikh hospital and put under arrest while his sons and former cronies were held in Cairo's Torah Prison.
The prosecution is an unprecedented moment in the Arab world, the first time a modern Mideast leader has been put on trial fully by his own people.
The closest event to it was former Iraqi leader Saddam Hussein's trial, but his capture came at the hands of U.S. troops in 2003 and his special tribunal was set up with extensive consultation with American officials and international experts. Tunisia's deposed president, Zine El Abidine Ben Ali, has been tried and convicted several times since his fall several weeks before Mubarak's, but all in absentia as he remains in exile in Saudi Arabia.
Mubarak, el-Adly, and six top police officers are charged in connection with the killings of protesters. All eight could face the death penalty if convicted. The charge sheet said that Mubarak "allowed (el-Adly) to use live ammunition" in the crackdown on protesters.
Separately, Mubarak and his two sons face charges of corruption. According to the prosecutors, the father and sons received five villas worth nearly $7 million from prominent businessman Hussein Salem in return for using their influence to get him a lower price for state land to build a resort complex in Sharm el-Sheikh.
Near Tahrir Square, the epicenter of the protesters, a dozen people swarmed around newspapers at a stand, reading headlines about the trial. One man spit on a picture of Mubarak on a front page.
"When he is in the cage and we know he is there, then we know we have started to put our feet on the path of justice," said the newspaper seller, Nabil Hassan, 65. "If he and his accomplices are in court, he becomes one of the people no different from anyone else facing justice. I have faith in Egyptian judges."
AP correspondents Tarek el-Tablawy, Sarah El Deeb and Aya Batrawy contributed to this report.