CAIRO - 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 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.

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 per cent,” 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.

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.