An Egyptian who was jailed as a teenager more than two years ago on charges that included "illegal protesting" has been freed from prison.

Mahmoud Hussein, now 20, was released from custody early on Friday on bail of 1,000 Egyptian pounds ($113).

The order to release him was upheld after prosecutors on Wednesday appealed against an earlier decision to free him.

Human rights lawyers and his brother Tito Tarek, who campaigned heavily for his sibling's freedom on social media, confirmed his release.

"After 789 days of his being unlawfully held in pretrial detention, without ever being charged with a crime, the Egyptian courts have finally done their job and upheld the rule of law, freeing Mahmoud from unlawful pretrial detention," Wade McMullen, a lawyer with the US-based Robert F Kennedy Human Rights group, which has acted on behalf of Hussein, told Al Jazeera.

"As Mahmoud's family welcomes him home tonight, we are also reminded of the 40,000 other political prisoners languishing in Egyptian prisons - many of them held in pretrial detention without charge just like Mahmoud has been - who all equally deserve their freedom."


READ MORE: The tale of Egyptian teen held for two years without trial


While no charges have been filed yet, the case against him is still ongoing, "from what we can tell", McMullen said, calling for the case to be dropped. 

'Tortured in detention'

The US-based Human Rights Watch group said that Hussein "still faces charges of protesting illegally and belonging to a terrorist organisation".

"There are thousands of detainees in Egypt who, like Hussein, have been held for egregiously long periods of pretrial detention, often in squalid conditions with restricted access to lawyers and medicine," Nadim Houry, deputy Middle East director at Human Rights Watch, said.

"The fact that prosecutors sought to keep him jailed, months after he was held beyond the legal limit, shows how far the authorities are willing to go to crush dissent."

Rights groups and lawyers acting on behalf of Hussein allege that he was tortured while detained and that towards the end of his detention, his health deteriorated.

"Egyptian authorities have more than two years of appalling injustice to make up for and they should start by setting up an investigation to look into allegations that he was tortured and otherwise ill-treated in detention," said Said Boumedouha, Amnesty International's deputy director for the MENA programme.

Hussein had to be carried into court on Thursday because of his poor health, added the UK-based human rights group.

'T-shirt detainee'

Hussein was arrested in Cairo on January 25, 2014, accused of illegal protesting, getting paid to protest, possessing Molotov cocktails, and belonging to a "terrorist" organisation.

He said he was walking home from a peaceful demonstration to commemorate the third anniversary of the January 25, 2011 revolution that ousted long-time president Hosni Mubarak when he was detained.

He was wearing a protest scarf and a T-shirt that read: "A nation without torture". He has since become known as the "T-shirt detainee".


READ MORE: Rights groups blast Egypt's civil society 'persecution'


While in prison, Hussein was subject to near-automatic detention renewals, more than 20 of which were decided in his absence from the courtroom.

Last year, a petition by Amnesty to release him was signed by more than 145,000 people in 138 countries.

Follow Anealla Safdar on Twitter: @anealla

Source: Al Jazeera