Cairo (CNN) -- Ousted Egyptian leader Hosni Mubarak got life in prison Saturday for his role in the killing of demonstrators, a sentence that saw angry protesters disrupt the proceedings.
Punches were thrown as victims' family members protested the verdict inside the court. Others stood on chairs, raising fists in the air and chanting the sentence was not enough.
The sentence handed down by Judge Ahmed Refaat was the final chapter of Mubarak's three decade, iron rule of Egypt that was brought to an end in February 2011.
Mubarak denied any role in the killings. About 840 people died and more than 6,000 others were wounded in the 18-day uprising, according to Amnesty International.
Handing down the verdict before a packed courtroom, Refaat praised the revolution and said it offered people relief after living "in 30 years of dark without any hope."
While the judge found Mubarak guilty for his role in the killings, he cleared the deposed leader of corruption and misappropriation of funds.
Refaat also chose the lesser of two sentences. Mubarak could have received the death penalty.
The judge also convicted former Interior Minister Habib El Adly of ordering security forces to kill protesters and sentenced him to life in prison. El Adly was convicted in May of corruption and money laundering, and sentenced to 12 years in prison.
The courtroom melee erupted after the judge cleared six of Mubarak's aides, primarily security officials, in connection with the killing of demonstrators. He also cleared Mubarak's sons -- Gamal and Alaa -- of corruption and using their father's political power for profit.
Mubarak and the judge were removed from the courtroom amid the outburst
Police restrained people inside the court while clashes broke out outside between police and protesters.
"People want the execution of Mubarak," some chanted. Others yelled "illegitimate, illegitimate verdict."
The general prosecutor ordered Mubarak's immediate transfer to the Tura maximum security prison, according to state TV.
When the trial opened, it was a spectacle few Egyptians thought they would ever see. Images broadcast worldwide showed the 84-year-old former leader wheeled in to the court on a hospital gurney and locked in a defendant's cage.
The trial was marked by chaos inside and outside the heavily guarded courtroom, with confrontations between prosecutors and defense attorneys, and clashes between protesters and police.
The verdict follows Friday's expiration of a notorious emergency law that ended 31 years of sweeping police powers. It comes ahead of a polarizing mid-June runoff in the presidential election that pits the Muslim Brotherhood's Mohamed Morsi against the more secularist Ahmed Shafiq, a former official in Mubarak's regime.
Mubarak became president in October 1981, ruling Egypt with an iron hand as a staunch ally of the United States.