This astounding debut novel, by British-Egyptian film-maker Omar Robert Hamilton, opens after the seeming triumph of the 2011 Egyptian revolution’s early stage has passed, though it is remembered, cinematically, as “an explosion of light, sound and epic consequence with no room for ego or doubt”.

Now the revolutionaries are flailing in various tides of counter-revolution. The new Muslim Brotherhood government forces through a constitution that ignores key revolutionary demands. Brotherhood “security” and a revived police force torture and murder at will. The army kills too, and prepares to seize control. To emphasise these reversals, though the story moves forward chronologically, parts one, two and three of the novel are titled Tomorrow, Today and Yesterday.

Crowds are evoked through disputatious voices. A large and striking cast of characters struggle in night-time streets, choke in traffic or on tear gas, argue in bars and wait in hospitals and morgues. They are brought together through the figure of Khalil. Palestinian-Egyptian, and American born, Khalil’s nationality, and people’s responses to it, is one way in which the novel questions the nature of community. (The author is the son of Egyptian writer Ahdaf Soueif and British poet the late Ian Hamilton.) Khalil’s partner Mariam is a medical worker seeking a life worthy enough to “conquer death with memory”, and a feminist, although she never mentions the word.

Khalil co-founds Chaos, a magazine, website and podcast (in the real world, Hamilton co-founded a media collective called Mosireen to comment on the revolution). Their office “becomes a cerebral cortex at the centre of the information war”. Significantly, the novel begins with the massacre of (mainly Christian) protesters outside Maspero, the state media HQ. Later, Khalil will have reason to repeat: “I wish we had taken Maspero.”

The revolutionaries set up illegal radio transmitters, write manifestos, crowd-source, make public art. Increasingly they also tend the wounded, comfort the bereaved, and find lawyers for the detained. Some of the people here are real, such as the imprisoned activist Alaa Abd el-Fattah, Hamilton’s cousin, to whom he dedicates the book.

Cairo, hyper-real but never overstated, is as large a presence as the title suggests: “A city of thousands of years past piled high upon each moment of the living present”, where “alleyways become complicit in your roguishness”. Cairo is also compared to jazz, “contrapuntal influences jostling for attention, occasionally brilliant solos standing high above the steady rhythm of the street”. That last metaphor could describe the novel itself.

Obstacles soon multiply, and swell beyond the narrowly political. Women are subjected to military “virginity tests”, and raped in Tahrir Square, dominated now by “men who infect the air with testosterone and territory”. In this mood, Cairo is “a city of women and another of men stalking in dark parallel”, and not only the nebulous regime but patriarchy – society itself – becomes the opponent.

“Something new is coming that we can’t see yet,” Mariam says. The most persistent arrival is death, and an accompanying “unbearable grace”. The novel pays reverent and repeated attention to the impact on the parents and friends of the dead, and asks what the dead are owed. The emotional, even spiritual shock of political deaths – their noisy horror and silent awe – has rarely been so well expressed.

When the army under General Sisi makes its move, more than 900 Muslim Brotherhood supporters are massacred. The unliberated radio justifies the slaughter by whipping up panic concerning infiltrators and Palestinian spies, while declaring that the army has developed a cure for Aids. (This claim was actually made.)

One of the Chaos crew shares the pro-Sisi hysteria. Another is killed. Unity splinters, energy dissipates, the protests shrink. “A million becomes a thousand becomes a hundred becomes one ... This is the long end of the extraordinary.” Cairo takes shape finally as “this sulfuric city of our dead, our metrocropolis [sic] of failure”, and Khalil asks in bitter retrospect if the revolutionary victory was confined to “two hours between the police retreating and the army deploying”.

The City Always Wins is a tale of defeat and dashed dreams and of hope’s persistence told in a poetic prose. The style is at once pared down and highly expressive. The tension between exuberance and restraint fits the subject matter and defines Hamilton’s method. He splits scenes to great effect, interspersing text messages, tweets and real headlines, raising the pitch until the final stretch of Khalil’s stream-of-consciousness. This private, continuous flow of thought at the end of the novel is an apt reflection of the retreat from collective, social energy to the individual and interior realm.

The relentless acceleration of pace mimics the confusion of the events, the sense of the people – who once seemed to hold the reins – losing control. Here is the novel form proving itself again, revealing far more than journalism can.

The City Always Wins is published by Faber. To order a copy for £12.74 (RRP £14.99) go to bookshop.theguardian.com or call 0330 333 6846. Free UK p&p over £10, online orders only. Phone orders min p&p of £1.99.