The letter, produced covertly from inside Bab el-Khalq prison where Abd El Fattah is being held, was handed to his pregnant wife, Manal, during a visit on Monday. It is being published in Arabic by the Egyptian newspaper al-Shorouk and in English by the Guardian, and is likely to intensify the growing divisions between Egypt's increasingly repressive army junta and pro-change activists on the street.

Abd El Fattah, one of Egypt's most prominent anti-regime voices and a former political prisoner under the Mubarak dictatorship, was taken into military custody on Sunday evening following public criticisms of the army's conduct on the night of 9 October, when at least 27 people were killed during a Coptic Christian protest in downtown Cairo.

Like many other activists, Abd El Fattah accused the army of direct involvement in the bloodshed, a claim that appears to be supported by extensive witness reports and video footage. He was charged by military prosecutors with "inciting violence against the army", and is being held initially for 15 days – a detention period that can be renewed indefinitely by the authorities. His arrest has provoked outrage across the Middle East and beyond.

In the prison letter, Abd El Fattah reflects on his incarceration under the toppled president Hosni Mubarak in 2006, and argues that despite Egypt's revolution very little appears to have changed. "I never expected to repeat the experience of five years ago," he begins. "After a revolution that deposed the tyrant, I go back to his jails?"

The 29-year-old is being held in what he describes a cockroach-infested 6x12ft cell with eight other men, who Abd El Fattah describes as "poor, helpless, unjustly held – the guilty among them and the innocent". Up to 12,000 civilians are believed to have been processed through military tribunals since the fall of Mubarak in February; those denied access to the normal civilian justice system include many accused of common crimes as well as political prisoners.

Often lyrical and poetic, but always expressing a quiet rage against the crimes of his military captors, Abd El Fattah's letter lays bare the crisis of legitimacy engulfing the Supreme Council of the Armed Forces (SCAF) which took power when Mubarak was toppled and promised to "defend the revolution", but has since dragged its feet on democratic reform and waged a campaign of repression against activists, journalists and demonstrators.

"I spend my first two days listening to stories of torture at the hands of a police force that insists on not being reformed; that takes out its defeat on the bodies of the poor and the helpless," he writes. Addressing the killing of Mina Daniel – a Coptic protester who died during the 9 October protest but has since been accused, like Abd El Fattah, of helping to instigate the violence, he says: "They [the military] must be the first who murder a man and not only walk in his funeral but spit on his body and accuse it of a crime."

Attempting to communicate with the outside world can be exceptionally risky in Egyptian jails. Last week a prisoner at Cairo's high-security Tora prison died after trying to smuggle a mobile phone SIM card into his cell; witnesses have said he was repeatedly tortured by prison guards who caused internal bleeding by inserting a large water house into his mouth and anus. Despite the dangers, Abd El Fattah has given his permission for his letter to be published.

This week Amnesty International released a statement condemning Abd El Fattah's incarceration, calling for an end to military tribunals for civilians, and repeating its contention that the armed forces played a role in the massacre of 9 October.

"The Egyptian military was part of the violence which occurred during the Maspero protests and is also leading the investigation into the bloodshed," said Philip Luther, the organisation's deputy director for the Middle East and north Africa. "This is totally unacceptable and raises serious and fundamental questions about the inquiry's independence and impartiality. Egypt's military authorities must allow an independent investigation into these killings if they are serious about bringing those responsible to justice."

Luthern added: "Military courts should never be used to investigate or try civilians. Such courts are fundamentally unfair, as they deprive defendants of basic fair trial guarantees."