The brother and lawyer of Mahmoud Mohammed Ahmed, a 20-year-old Egyptian who was arrested for wearing a T-shirt with a slogan against torture, say a court on Thursday ordered his release on bail after nearly two years in detention without trial.

Ahmed was 18 when arrested on Jan. 25, 2014, the third anniversary of the uprising that toppled longtime ruler Hosni Mubarak. The day was marred by deadly clashes between police and protesters.

When arrested, Ahmed was wearing a T-shirt that bore the slogan "A nation without torture," something that helped turn his case into a cause celebre by Egyptian rights activists campaigning for an end to random detentions and torture by police.

Ahmed's brother and lawyer say he was tortured in detention and deprived of many of his rights.