CAIRO (AP) — The two sons of ousted Egyptian President Hosni Mubarak were ordered released on bail Thursday pending a retrial in the last case that was keeping them behind bars, paving the way for their release for the first time since they were incarcerated in the wake of their father's 2011 ouster.

It is not clear when Gamal and Alaa Mubarak would be released or whether prosecutors would appeal the court decision, which came three days before the fourth anniversary of the protests that eventually forced Mubarak to step down. The release of the two sons, widely reviled as symbols of corruption during Mubarak's nearly three-decade rule, could inflame public sentiment.

Mubarak was believed to have been grooming his younger son for the presidency. Gamal's imprisonment was seen as a popular verdict against those aspirations.

Dozens of protesters gathered near Cairo's Tahrir square to protest the decision to release Mubarak's sons. Police rapidly moved in to disperse them, using tear gas to flush them out of downtown side streets. Thirteen were arrested, a security official said on condition of anonymity because he was not authorized to speak to reporters.

Thousands of Islamists were imprisoned and hundreds were killed in street clashes after the military ousted President Mohammed Morsi in the summer of 2013 following mass protests against his year in power. Hundreds of young activists are also detained and facing trial for protesting, with some having received tough sentences.

Shady Ghazali Harb, an activist who was among those who spearheaded the 2011 protests, said the court order is the latest in a series of decisions that exonerate Mubarak and snub those who took to the streets demanding change.

"I think there is an attempt to create a new reality and impose it on society and the youth, that even though the state claims to be celebrating the Jan. 25 revolution as a national holiday, everything associated with it is retreating and not coming true," Harb told The Associated Press. "They are betting on frustrating any hope for change."

"This will lead to a new clash between the youth, who represent the majority of the population, and the regime. Even if not immediately," he said.

The Mubarak sons were sentenced to four years in prison on charges of using state funds to renovate family residencies. Their father got three years in the case.

The sentences were overturned earlier this month. Mubarak, who will turn 87 in May, has been held in a military hospital in a southern Cairo suburb and is likely to stay there despite there being no legal grounds for holding him.

The two sons face another trial on charges of insider trading, and another court had ordered their release pending trial. That trial resumes in March.