CAIRO — Heshan Amin, a 24-year-old student, sits with his head in the hands, just a few hundred feet from Tahrir Square, where he and his friends fought the police during the Jan. 25, 2011 revolution. He had broken the government-imposed curfew to come here when news reached him that Egypt's toppled leader Hosni Mubarak would be released from prison.
"I feel like I stabbed myself in the back, I didn't know going to the streets to protest would give me such false hope," Amin says bitterly. "I have been protesting for change for two years and look where we are. Mubarak is walking and the country is on fire."
Egypt's prosecutor general announced Wednesday night that the release of Egypt's longtime autocrat is final. However, state media reported that the country's prime minister quickly ordered that Mubarak would be placed under house arrest -- part of the "emergency measures" instituted in the country after the military ousted President Mohamed Morsy last month.
Mubarak's release from prison is ill-timed: Violent battles between security forces and Morsy's supporters have rocked the nation in the past week, leaving hundreds dead. But however politically charged Mubarak's release may be, there is a solid legal justification behind the decision.
More than two years after Mubarak fell from power, he still has not been found guilty of a crime. In June 2012, a court did find him guilty being involved in the killing of protesters -- but that verdict was overturned when the court of appeal found procedural errors in the case.
As the aged autocrat awaits a retrial in that case, he ran out the clock on the maximum time in pre-trial detention allowed under Egyptian law, explains Hoda Nasrallah, a lawyer for the Egyptian Initiative for Personal Rights (EIPR).
"Two years is the maximum period allowed for defendants accused of committing a crime that carries the death penalty, in his case the killing of demonstrators," says Nasrallah, who has represented protesters killed during the January uprising.
Since April 15, Mubarak had been detained based on other cases against him, such as profiting from export of gas to Israel, appropriating funds for the upkeep of the presidential palaces, and receiving gifts from state-owned press institutions. But at some point, Nasrallah said, those endless extensions had to come to an end.
By this week, the only pending case was the charges against him for receiving gifts from state-owned media. "His lawyers contested his detention, as he had repaid the value of the gifts [that the] state-owned news outlet Al-Ahram had given him," Nasrallah says.
Mubarak could still be re-imprisoned as the cases against him proceed. But whether or not that happens, his trial has still been a signature disappointment for those who hoped that the 2011 revolution would usher in a country governed by the rule of law.
"It has been a sham trial since day one, there has been a lack of political will and a commitment to justice," says Karim Ennarah, a member of the criminal justice team at EIPR, who has closely observed the case. "Thousands of testimonies were dismissed from the 18 days. We also have structural problems with the judiciary."
One of the issues, Ennarah continues, has been the judiciary's lack of faith in technology. Videos, Ennarah explains, are not trusted as reliable evidence by the judges, who fear they could be doctored. "They still get government experts to comment on the videos, who can be biased," he said.
Nasrallah says the case was quickly taken to court "to please the people in the streets" without collecting enough evidence, a move which hampered the trial from the beginning. Nor is it easy to prove that Mubarak was directly involved in the police crackdown during the uprising -- his defense team, after all, insists that he was unaware of most of the actions his own security forces were taking.
"They can prove that he didn't know about the security forces' plan from the beginning," Nasrallah says.
The largest problem has been that the same police force tasked with collecting evidence in the trial was the body largely responsible for the killings. This conflict of interest, Nasrallah said, meant that the police hampered the investigation at every turn. "[T]he prosecution had to do the investigating, which is not their job," she says. "They are not trained nor have the political will to do it."
Other state agencies have been just as obstructionist as the police. Egypt's General Intelligence Service sent the prosecutor general tapes that did not have any evidence on them, claiming the relevant recordings had been "taped over."
Nasrallah relates another disaster: A senior police officer said he "accidentally" wiped a crucial CD containing calls from the operations room of the Central Security Forces. Without such information, it is impossible to prove that the police crackdown on the street during the 18 days of revolution in 2011 was ordered by the top political officials of the Mubarak era
Even if he walks, Mubarak is due back in court on Aug. 25 for another hearing of his retrial. The timing provides an insight into the tumultuous period through which Egypt is currently passing: On the same day, six top Muslim Brotherhood leaders will also be in the dock - placed there on charges arising out of their opposition to the new government.
This has led many to fear the legal system is once again helping out the old regime. For the protesters who have been fighting for a new Egypt, it is hard news to swallow.
"Mubarak will be acquitted, it's clear. If that happens, I give up," says Amin. "To be honest, I don't think protesting brings anything anymore. In the end, it's just people sitting in the street."