An Egyptian court on Wednesday sentenced ousted president Hosni Mubarak to three years in prison on charges of stealing public funds.

"The court orders Mohammed Hosni Mubarak to be sent to prison for three years," said the judge as Mubarak looked on from a cage flanked by his sons.

Mubarak's sons, Alaa and Gamal, were sentenced to four years in prison on the same charges.

They were accused of embezzling some $17.6 million set aside for renovating presidential palaces, according to the BBC.

The 86-year-old has been under house arrest at a military hospital since August pending retrial in a case of complicity in killing protesters during the 2011 uprising that ended his rule.

The court fined Mubarak and his sons 21.197 million Egyptian pounds ($2.98 million) and ordered them to repay about 125 million Egyptian pounds of funds the court said they had stolen.

Mubarak's former intelligence chief, Abdel Fattah al-Sissi, is poised to be elected president next week.

The verdict may please some Egyptians who lived through three decades of autocracy under Mubarak, but analysts say that businessmen still loyal to him are still influential. Rights groups say that abusive practices of the Mubarak regime are alive and well as another former military man prepares to take the

reins of power.

It was not immediately clear if the three years Mubarak and his sons have already spent in jail would be counted toward the sentence and if Mubarak would return to the army hospital or be sent to prison.

Meanwhile, an Egyptian court sentenced 155 Muslim Brotherhood supporters to jail terms Wednesday and gave 54 of them life sentences, judicial sources said, in a case related to violence in the Nile Delta province of Mansour last August after the army's ouster of President Mohammed Morsi.

Other defendants were sentenced to between three to 10 years in jail. The charges included instigating violence and chaos and membership in a banned group. Police fired tear gas at demonstrators outside the courthouse who were chanting against the verdict.