By Ali Abdelaty
CAIRO, Jan 22 (Reuters) - An Egyptian court ordered the release of the sons of ousted president Hosni Mubarak on Thursday pending a retrial, their lawyer said, as rare protests erupted days before the anniversary of the 2011 uprising that toppled the autocrat.
Lawyer Farid el-Deeb said the order for the release of Alaa and Gamal Mubarak should mean they immediately walk free.
The Cairo Criminal Court said in a document explaining its ruling that the two men had already served the maximum permitted time of 18 months in pretrial detention and should therefore not be held pending their retrial in a corruption case.
The retrial was ordered by Egypt's high court earlier this month. A court had already dropped other graft charges against the sons in November.
Egypt has witnessed rare street anti-government protests before the anniversary of the popular revolt that ended three decades of iron-fisted rule under Mubarak and raised hopes of greater freedom and accountability.
Tensions have been rising for the first time in months.
On Thursday, security forces quickly dispersed protesters in downtown Cairo after a similar incident on Wednesday night in the same area.
Muslim Brotherhood supporters blocked traffic in Egypt's second city of Alexandria on Thursday and hurled Molotov cocktails, security sources said. Thirteen people were arrested.
The army, led at the time by Abdel Fattah al-Sisi, removed the Brotherhood from power in 2013 after mass protests against their rule. It has since mounted a tough crackdown on the Islamist movement.
Sisi, who served as Mubarak's military intelligence chief, went on to become Egypt's elected president.
In November, a court dropped charges against Mubarak of conspiring to kill protesters in the 2011 uprising, raising fears among human rights activists that the old guard was making a comeback.
Last May, the 86-year-old former president received a three-year sentence and both sons were jailed for four years in a case in which all were charged with diverting public funds to upgrade family properties.
It was not immediately clear why the court did not also order Mubarak's release on Thursday as he awaits retrial on these charges along with the sons.
Suffering from ill health, Mubarak has been serving his sentence in a military hospital in the upscale Maadi district of Cairo. Judicial sources have said he could soon walk free as he currently has no convictions against him. (Additional reporting by Mahmoud Mourad; Writing by Maggie Fick; Editing by Michael Georgy and Mark Trevelyan)