CAIRO - An Egyptian court dismissed Saturday a murder charge against former president Hosni Mubarak over the deaths of protesters during a 2011 uprising, after a dramatic retrial in which he defended his three-decade rule.
The court also acquitted the ex-strongman of a corruption charge, but he will remain in detention because he is serving a three-year sentence in a separate graft case.
Seven of his security commanders, including the feared former interior minister Habib al-Adly, were acquitted in connection with the deaths of some of the roughly 800 people killed during the revolt.
Cheers broke out in the courtroom and Mubarak's two sons and co-defendants stooped down to kiss his forehead when the judge read out the verdict, as Mubarak, 86, lay in an upright stretcher inside the caged dock.
Corruption charges against the sons, Alaa and Gamal, were also dropped.
The usually stone-faced Mubarak, wearing his trademark shades, allowed himself a faint smile.
He was later transported back to a Cairo military hospital where he is serving his sentence, appearing in a wheelchair from a balcony door to wave at supporters gathered at the gates.
His lawyer Farid al-Deeb told AFP that the verdict was "a good ruling that proved the integrity of Mubarak's era." An appeals court had overturned an initial life sentence for Mubarak in 2012 on a technicality. Saturday's verdict may also be appealed.
Many Egyptians increasingly look to the former autocrat's stable era with nostalgia in light of the turmoil that followed his overthrow.
His successor Mohamed Morsi, a leader of the main Islamist opposition group under Mubarak, was toppled by the army himself in 2012 following massive protests.
Mubarak's supporters leapt out of their benches in celebration when the judge pronounced the verdict, chanting: "Say the truth, don't be scared - Mubarak is innocent." Some rushed over to his lawyer to congratulate him.
The ruling came after a retrial lasting more than a year in which many witnesses, including Mubarak's former police and intelligence commanders, appeared to exonerate him in their testimony.
Outside the court venue, a sprawling police academy on Cairo's outskirts, relatives of those killed in the revolt were appalled at the verdict.
"It's an oppressive ruling. The blood of my son has been wasted," said Mostafa Morsi, whose son was killed outside a police station during the uprising.
In Cairo's Tahrir Square, the hub of the anti-Mubarak revolt, passers-by were divided on the outcome.
"Justice for the martyrs has been lost," said one woman in her 50s.
Others disagreed. "There is no evidence against Mubarak. He was an honest president," said Mostafa Saed, a retired government worker.
Protesters at the time of the revolt vented years of pent-up fury over police abuses and corruption by attacking and torching stations across the country, leaving the interior ministry on the brink of collapse.
Chief judge Mahmud Kamel al-Rashidi, 63, suggested his ruling was made with a clear conscience as he approached the end of his life.
"God will ask me what did you do in this world, and specifically what did you do as a judge," he told the court before pronouncing his verdict and brandishing a thick copy of the reasoning behind his decision.
He said he dropped the murder charge against Mubarak because the prosecution should not have added him to the case they had initially made against his security chiefs.
During the retrial, Mubarak told the court that he was innocent and praised his own rule, saying it was a time of economic growth.
"The Hosni Mubarak before you would never have ordered the killings of protesters," he said.
Mubarak had pleaded to stay on as president for a few months during the 2011 uprising to oversee the writing of a new constitution, but the hundreds of thousands of protesters who rallied daily demanded he immediately step down.
Since then, once-banished Mubarak-era officials have made a comeback, using a widespread backlash against former opposition figures blamed for the tumult since the strongman's overthrow.
The police force is now feted in the largely pro-government media as it wages a deadly crackdown on pro-Morsi Islamist protesters and militants.
Prime Minister Ibrahim Mahlab was a senior official in Mubarak's now dissolved party, something that would have been unthinkable in the months following the strongman's ouster.
Mubarak's former military intelligence chief Abdel Fattah al-Sisi is now president, having won an election after overthrowing Morsi last year.
Hundreds of members of Morsi's Muslim Brotherhood movement have been sentenced since his downfall.
Morsi himself is standing several trials, including one for taking part in jail breaks and violence during the anti-Mubarak revolt.