CAIRO (AFP) - Egypt's former president Hosni Mubarak and his security chief were given life in prison Saturday over the deaths of protesters in 2011, but the acquittal of six police chiefs sparked calls for mass protest.
Mubarak, the only autocrat toppled in the Arab Spring to be put in the dock, could have gone to the gallows as demanded by the prosecution.
The verdict prompted outrage both inside and outside the courtroom, with protesters staging angry rallies in Cairo, Alexandria and other Egyptian cities.
Judge Ahmed Refaat sentenced the 84-year-old former leader and his interior minister Habib al-Adly to life for their role in the deaths of more than 800 protesters during the revolt that ousted them, but acquitted the six security commanders on the same charges.
A senior member of Mubarak's defence team told AFP the former strongman will appeal the sentence.
A tearful Mubarak, who enjoyed near absolute power for three decades, was flown to Tora prison on Cairo's outskirts after the verdict but then refused to leave the aircraft.
A security official said Mubarak "suffered from a surprise health crisis" but was finally convinced to return to his cell.
Chants of "Void, void" and "The people want the judiciary purged" could be heard after the sentencing, as furious lawyers told AFP they feared Mubarak would be found innocent on appeal.
The powerful Muslim Brotherhood told AFP it had called for mass protests nationwide, while other groups including the pro-democracy April 6 movement announced they would take to the streets in protest.
Thousands of people marched on Cairo's Tahrir Square, epicentre of the protests that toppled Mubarak, chanting against the judiciary and the military council that took power when Mubarak was forced out.
"Either we get justice for our martyrs or we die like them," some shouted.
There were similar rallies in the Mediterranean city of Alexandria and other parts of Egypt, where many were in shock at the acquittal of the police chiefs.
Rights groups slammed the verdict as failing to deliver full justice.
Mubarak's sentence "is a significant step towards combatting long-standing impunity in Egypt" but the security chiefs' acquittal "leaves many still waiting for full justice," Amnesty International said.
"Many see the acquittal of all the senior security officials as a sign that those responsible for human rights violations can still escape justice."
Human Rights Watch Cairo-based researcher Heba Morayef told AFP "the verdict fails to deliver justice, it fails to deter police from future abuse and it comes against the backdrop of acquittals in police trials."
Corruption charges against Mubarak's sons, Alaa and Gamal, were dropped because of the expiry of a statute of limitations, and the ex-president was acquitted in one of the graft cases.
But Alaa and Gamal will stay in prison because they are on trial in another case.
"We will appeal. The ruling is full of legal flaws from every angle," Yasser Bahr, a senior member of Mubarak's defence team, told AFP.
"We will win, one million percent," he added.
Mubarak, in dark sunglasses and wearing a beige track-suit, had his arms folded and showed no emotion inside the caged dock as Refaat read the verdict.
His sons, however, appeared close to tears.
"It's vindicating to Egyptians to see Mubarak and his interior minister sentenced to life, but the verdict raises more questions than answers," said Hossam Bahgat, the director of the Egyptian Initiative for Personal Rights.
"The court appears to have found no evidence that the killings were committed by policemen. It seems the court convicted Mubarak and Adly for failing to prevent the killings," Bahgat told AFP.
"It's 100 percent certain that this will go to appeal and the court is very likely to order a retrial."
In delivering the ruling, Refaat painted a grim picture of life under Mubarak, listing hardship after hardship during his three-decade rule.
Refaat said the protesters who joined the uprising were "peaceful" and wanted only "justice, freedom and democracy."
Clashes erupted outside the courtroom after the sentencing, with police using stun grenades against angry crowds.
Mubarak, Adly and the six others had faced charges over their involvement in ordering the deaths of some of the estimated 850 people killed in the uprising.
Egypt has been ruled by the military since Mubarak was forced out on February 11 last year after 18 days of protests nationwide.
Mubarak was held at a hospital in the Red Sea resort of Sharm el-Sheikh following his arrest, before the military appeared to bow to protester demands that he and ex-regime officials face trial.
The military insists that the prosecution case and charges were independent judicial decisions, but critics say the investigation was hasty and sloppy, resulting in a trial based on patchy evidence that may see Mubarak acquitted.
The trial began on August 3 last year, and Mubarak has been held in Cairo ever since.
During the trial, Mubarak was wheeled into the courtroom on a stretcher. He reportedly has a heart condition, but the health ministry has denied his lawyer's assertion that he has cancer.
Saturday's verdict comes just two weeks before a presidential election run-off that will pit Mubarak's former premier Ahmed Shafiq against the Muslim Brotherhood's Mohammed Mursi in a highly polarised race.
It is the first openly contested presidential election in any of the Arab countries swept by protests and uprisings challenging decades of autocratic rule.