Alaa and Gamal Mubarak walked free from Cairo's Torah Prison early on Monday and headed to their homes in the suburb of Heliopolis, security officials said.
Last week, a court ordered that the two men be freed pending retrial along with their father for embezzlement.
It found that they had already served the maximum pre-trial detention period.
Although their release had been expected, it follows deadly clashes on Sunday between police and anti-government protesters commemorating the uprising.
Some of the anger that led to Mr Mubarak's overthrow was fuelled by the widespread belief that he and his sons had illegally amassed vast amounts of wealth.
Gamal, 51, was a leading member of the former ruling National Democratic Party and was widely seen as his father's heir apparent. Alaa, 53, was a leader among the business elite.
Both were detained along with their father in April 2011 and subsequently charged with corruption, embezzlement and insider trading.
In May, they were sentenced to four years in prison for embezzlement, after being found guilty of fraudulently billing the government for $14m (Â£9.3m) of personal expenses.
But that conviction was overturned earlier this month by the Court of Cassation, which found that legal procedures had not been followed properly and ordered a retrial.
The brothers were acquitted of the separate corruption charge - which related to the sale of a plot of land - in December 2013, while the insider trading case has yet to go to trial.
Hosni Mubarak's conviction for embezzlement was also overturned in the last remaining case keeping him behind bars.
The ailing 86-year-old is residing at a military hospital in the southern Cairo suburb of Maadi, and it is not clear when he will be released.
Charges of conspiring in the killing of hundreds of protesters during the uprising that ended his rule in 2011 were dropped in November.
The two sons of Hosni Mubarak have been released from jail, a day after the fourth anniversary of the uprising that ousted the former Egyptian president.