CAIRO, Egypt - An Egyptian court has sentenced former president Hosni Mubarak to life in prison for complicity in killing more than 800 protesters during last year's revolution, a first in the Arab world and a major achievement for the revolution which toppled him nearly 18 months ago.
Judge Ahmed Refaat acknowledged problems with the prosecution's case, which was widely criticised by legal experts.
Prosecutors did not present evidence that Mubarak, 84, directly ordered the killings. But Refaat faulted the former president for not stopping them, and delivered a speech during Saturday's court session about what he called the "dark days" of Mubarak's rule.
The judge stressed several times that the protesters last year were non-violent.
"They marched peacefully towards Tahrir Square, demanding justice, freedom and democracy," he said.
The verdict at first drew an ecstatic reaction from a small crowd gathered outside the Cairo police academy, the site of the trial. Many of the demonstrators had family members killed during the revolution.
There was no way to watch the trial from outside the police academy, so the crowd huddled around cars and portable radios to listen.
When the judge read Mubarak's sentence, a huge cheer erupted from the crowd; some people fired sparklers into the air, while others fell to their knees to pray.
One elderly couple knelt on a poster bearing a photograph of their dead son, crying and shouting: "God is great."
"I thank God. I thank God, and I thank the judge. This is a victory for all the Egyptian people … this will not make [my son] come back, but this is just," said Umm Saber, whose son was killed by security forces last January.
Joy turns to fury
But among many in the crowd, the initial excitement quickly gave way to scepticism and frustration over the extent of Mubarak's sentence and the acquittal of four aides.
There was heavy security outside the courthouse, with more than 5,000 police deployed [Al Jazeera]
Some people had hoped for a death sentence. "He should hang," said Umm Farouq. "He kills the Egyptian people for being hungry, and now he can live in prison, in comfort."
Mubarak has been held since last year not in prison, but in a military hospital, which many local media reports have described as a comfortable facility.
The president was brought to Tora prison after the verdict, and reportedly initially refused to leave his helicopter; state media reported that he had been admitted to the prison's hospital after eventually disembarking from the aircraft.
Habib el-Adly, Mubarak's longtime interior minister, was also sentenced to life in prison for his role in the killings.
Many people had expected him to receive a death sentence.
Several of Adly's top aides, including the former heads of Cairo security and the notorious Central Security Forces, were acquitted of any role in killing protesters.
'Bankrupted this country'
Mubarak was acquitted on corruption charges. His two sons, Gamal and Alaa, were also acquitted, a ruling that prompted anger outside the courtroom.
"They bankrupted this country and now they are free?" one man yelled incredulously into a loudspeaker.
The judge said those charges were dismissed because they dealt with crimes which occurred more than a decade ago.
Gamal and Alaa will remain in custody, however, because they were charged earlier this week with stock market fraud.
"They can just take the money they stole and, whoosh," said Mustafa al-Helmy, using his hands to mimic a running man.
A small group of pro-Mubarak demonstrators held their own rally outside the police academy, separated from the victim's families by hundreds of police officers and dozens of armoured vehicles.
One of them held a sign proclaiming Mubarak "a hero of peace and war".
"He was a great man who fought for his country," said a man who gave his name only as Ahmed. "They [the opposition] just want revenge, but this is not justice."
'His right hand becomes president'
Following the announcement of the verdict, several groups called for protests to be held across the country.
By mid-afternoon, hundreds of people had converged on Cairo's Tahrir Square, with larger crowds expected in the evening.
Almost 1,000 people staged a separate march to the supreme court, where they threw rocks and broke windows.
There were also protests in the northern city of Alexandria, where thousands gathered shouting slogans against Mubarak, demanding that he face the death penalty, Al Jazeera's Jamal Elshayyal reported.
The Muslim Brotherhood released a statement calling the verdict shocking" to "the families of the martyrs".
The group said it would participate in protests on Saturday.
Ahmed Shafiq, one of the two candidates in the presidential runoff later this month, released his own statement, which said the verdict proved that "no one is above accountability".
The sentence will present a political question for the next president, once he is elected after a June 16-17 runoff.
Many Egyptians expect Shafiq to pardon Mubarak if he wins. Mohammed Morsi, the Muslim Brotherhood's candidate, vowed this week to keep the former president in prison "forever".
Many people dropped to their knees to pray or cry after the verdict [Al Jazeera]
"The public prosecutor did not carry out its full duty in gathering adequate evidence to convict the accused for killing
protesters," said Yasser Ali, campaign spokesman for Morsi.
Many of the demonstrators outside the police academy quickly linked the verdict to the runoff election. Some said Shafiq should have joined Mubarak and Adly in the dock.
"He isn't the only one," said Karim al-Azazi, referring to Mubarak.
"SCAF [the country's ruling military council] has killed so many of us.
"Remember Abbasiyya. Remember Mohamed Mahmoud," he said, referring to two major confrontations with security forces in recent months.
More than 40 people were killed during the week-long clashes on Mohamed Mahmoud street in November, and nine people were killed in Abbasiyya, near the defence ministry, in May.
"Mubarak goes to jail, but his right hand becomes president," he said, shaking his head.