Zakaria Azmi, who was chief of staff under former president Hosni Mubarak, left the headquarters of the Cairo Security Directorate on Thursday after procedures for his release were concluded.
Azmi was convicted by an Egyptian court on charges of corruption in 2012, and sentenced to seven years in prison and a fine of LE36.4 million ($6 million). He was recently granted an appeal for a retrial.
His release was ordered by a court on Wednesday on the grounds that a suspect cannot be held in prison for more than 18 months.
Azmi is still under investigation in several other cases related to profiteering and abuse of power.