Baghdad: City of Peace, City of Blood. By Justin Marozzi. Allen Lane; 458 pages; £25. Buy from Amazon.com, Amazon.co.uk

AT THE height of the struggle between American troops and Arab insurgents in Iraq less than a decade ago, residents of the capital, Baghdad, woke up every day wondering if it might be their last. They perished in bloody batches, mostly at the hands of Iraqis, blown to pieces by car bombs or pulled out of minibuses and executed at rogue checkpoints, their bodies rolled into the Tigris river. Visitors were warned by residents with limitless gallows humour about eating the local grilled fish, masguf—for you know what they snack on.

The many other devastating wars of recent decades notwithstanding, the urban bloodletting along the Tigris shocked the world. Americans asked why they were expending so much of their own blood to civilise a place that seemingly gloried in barbarism. Did Saddam Hussein embody Baghdadis, rather than just repress them? Justin Marozzi’s epic history of Baghdad, subtitled “City of Peace, City of Blood”, both reinforces this sense and gives good reasons to see beyond it.

Baghdad was born in 762AD straight into the fitna, the split between Sunni and Shia Muslims. The Sunni caliph Mansur, whose new empire stretched from India to the Atlantic, sailed up and down the Tigris to reconnoitre a place for his home. He settled on an S-bend that abutted desert tracks running from the Levant to Persia. When he died a decade later he left behind a crypt filled with the corpses of Shia men, women and children. This was the beginning, says Mr Marozzi, “of a pattern of bloodshed that can be traced across the centuries”. Saddam was by no means alone in the tyrants’ gallery.

And yet, in between the slayings and sackings, Baghdad also gained a reputation as one of the most cultured places known to history. Its storytellers, scientists, artists and scholars, perched at the crossroads of Eurasia, left marks as deep as those of the cruellest rulers. They translated most of what was known to the ancient world into Arabic, pioneered irrigation systems in the fertile strip between the Tigris and the Euphrates, stocked one of the world’s great libraries and composed much of the “Arabian Nights”.

To enliven such dusty tales, Mr Marozzi plunges into the modern city, dangers and all, to visit tombs and charnel grounds and to interview current residents, including Ahmed Chalabi, the man who egged the Americans on to invade in 2003 and then turned on them with a guile that would have been familiar to his forebears.

Curiously, Mr Marozzi is rather vague about what he was doing in Baghdad when not communing with the past. He in fact played a minor role in its modern history, working for one of the security companies that was hired by the American army. A clue is the coy thanks to Tim Spicer, a British mercenary, at the start of his book.

Be that as it may, Mr Marozzi is brave in more ways than one, as are his publishers. Baghdad has been overrun by foreign writers, as well as soldiers, in the past decade, and now the world is bored with it, even though Iraq is sliding back into mayhem; 800 Iraqis were killed last month, a worse rate than in 2008, when the Americans were stanching a previous bout of sectarian bile. The end of history is not in sight.