CAIRO — Egypt’s top appeals court cleared former President Hosni Mubarak of any responsibility for the killing of hundreds of people during the 2011 protests that ended his 30-year rule, sweeping away the final legal hurdle to Mr. Mubarak’s release from detention.
The ruling drew cheers from Mr. Mubarak’s supporters, who have in recent years cast off the stigma once associated with his name to air increasingly vocal demands for his release. But it marked a bitter landmark for the millions of Egyptians who risked their lives to oust Mr. Mubarak and his circle during the heady, 18-day uprising in early 2011.
None of the Mubarak-era figures who grew rich and influential during his time in power are still in jail. The sole exception is Mr. Mubarak himself, who has been under guard for years at the Maadi Military Hospital in Cairo, at a room overlooking the Nile.
But the decision to keep him in detention is widely seen here as a political matter rather than a legal one — constructed to avoid any embarrassment to Egypt’s current leader, President Abdel Fattah el-Sisi, who sometimes praises the 2011 revolution.
In contrast, thousands of Egyptians who rose against him in 2011 are stuck in prison, in many cases after mass trials that drew stinging international criticism. The prisoners include supporters of the banned Muslim Brotherhood, but also activists, lawyers and journalists who dared to challenge Mr. Sisi.
“It’s pretty telling that Mubarak, who ran the country into the ground, gets acquitted, and people who gave their everything to try and do something for the country are sitting in prison,” said Ahdaf Soueif, an author whose nephew, the activist and blogger Alaa Abd El Fattah, is in jail.
Some Egyptian prisoners have been held without trial for years, often in terrible conditions, in stark contrast with the relatively gilded conditions enjoyed by Mr. Mubarak. According to supporters who have visited him, Mr. Mubarak gets papers, food deliveries and a constant stream of visitors.
Occasionally, Mr. Mubarak emerges onto the balcony to wave at cheering supporters gathered at the hospital gates. His sons Alaa and Gamal, who were convicted on charges of embezzling millions of dollars of state money, were released from prison in 2015 and are often sighted in restaurants and shops in upscale Cairo neighborhoods.
In the past six years, Mr. Mubarak has faced a slew of criminal charges for corruption and misrule. He was often seen glowering with anger when he appeared in court and was forced to sit inside a cage. But he has been convicted in just one corruption case, which concluded in 2015 when an appeals court upheld a three-year sentence. The judge allowed Mr. Mubarak to count time served against the sentence.
Yousri Abdelraziq, a lawyer and Mubarak supporter who was present in court for his acquittal on Thursday, said the former president was in a buoyant mood. “He fully intends to go home, perhaps in a month or two,” he said.
He suggested that Mr. Mubarak might want to go to his palatial villa at the Red Sea resort of Sharm el Sheikh, which was the subject of a different, failed corruption case.
The final case against Mr. Mubarak centered on accusations that he ordered shootings by security forces that led to the deaths of 239 people during the 2011 uprising. In 2012, a court sentenced Mr. Mubarak to life in prison, but an appeals court ordered a retrial, which resulted in his initial acquittal in 2014.
Thursday’s ruling confirmed that acquittal, prompting renewed speculation that Mr. Sisi might release Mr. Mubarak from detention, though it could prove politically awkward. In speeches, Mr. Sisi regularly pays tribute to the 2011 uprising, which was supported by the Egyptian military.
“If they let Mubarak out, what does that say about 2011 — that the military got it wrong?” said Hisham A. Hellyer, author of “A Revolution Undone: Egypt’s Road Beyond Revolt.”
Still, Mr. Sisi’s rule is more strongly defined by the tumultuous events that brought him to power, when the military he led toppled the democratically elected president, Mohamed Morsi of the Muslim Brotherhood, in 2013. Since then Mr. Sisi has cracked down hard on the Brotherhood, while his supporters have sought to portray the events of 2011 as a result of foreign interference in Egypt.
Some Egyptians believe that Mr. Sisi might want to free Mr. Mubarak before the presidential election set to take place next year, as a means of drawing a line under the 2011 uprising. Mr. Sisi himself has yet to make his views clear.