A Cairo criminal court has ordered the release of Alaa and Gamal Mubarak, the sons of former president Hosni Mubarak.
The two men are being re-tried on charges related to corruption and illicit gains.
The president's sons have been detained pending investigations since May 2011.
However, both sons will remain in custody as they are facing other corruption charges.
The court ruled that both Alaa and Gamal Mubarak have been detained in prison beyond the maximum period of provisional detention mandated by the law.
The court also ordered the re-trial of former president Hosni Mubarak, who faces charges of complicity in the killing of demonstrators during the 2011 uprising, along with other graft charges, be resumed on 6 July.