‘Two of their buildings fell down and they think they know about the world’s darkness, about how unsafe a place it is capable of being!” remarks a character in Nadeem Aslam’s The Wasted Vigil (2008). That was a novel set in Afghanistan amid the ruins of war, juxtaposing eastern and western characters united by the experience of loss. He continued with this setting in his The Blind Man’s Garden (2013), this time populating Afghanistan with characters from his native Pakistan. Now, in his fifth novel, Aslam returns to Pakistan itself for the first time since his 1993 debut, Season of the Rainbirds. And the country he depicts is one bent on completing what the west has begun with the wars in Iraq and Afghanistan, by revealing quite how dark and unsafe the world can be. This is a landscape of irrational sectarian violence, rivalry and cruelty.

The novel opens with the death of the middle-aged architect Massud, who leaves behind his wife and collaborator Nargis. Together, they have created a collection of exquisite buildings and fought for culture in a hostile world. He is accidentally shot during the inauguration of a new library they’ve designed in the fictional city of Zamana, as they form part of a mile-long human chain to transport the precious books to their new home. After Massud’s death, the grieving Nargis is left as guardian to Helen, the daughter of their Christian servants, whom they have brought up as a kind of surrogate child. Both are in danger. Nargis is pursued by a US intelligence officer, who wishes her to publicly forgive the American who killed Massud. Helen is the target of Islamic extremists who see her journalism as heretical and believe that Christians should be driven from Pakistan.

As in all his previous novels, Aslam mingles beauty and pain, but this time he gives the beauty more breathing space than he has for a while. Helen falls in love with Imran, a Kashmiri terrorist-in-training, who has escaped from his camp after realising that he was expected to engage in brutal acts in Pakistan. Prospero-like, Aslam creates an enchanted island for his young lovers, presided over by the mournful Nargis. She and her husband had built a mosque on this deserted island on the outskirts of Zamana, intended through its architecture to heal the rifts between different branches of Islam. The original plan was that a Hindu temple and a church would be erected beside it. However, this idealism proved misplaced, and the island was abandoned after a murder was committed inside the mosque. Now the trio retreat from the world, able to forget their religious and national differences. But they know they will be discovered and undergo more suffering.

The trio retreat from the world and forge a pan-religious, pan-national haven. But they know it cannot last

If the symbolism sounds heavy, then that’s because it is. There’s also a book, written by Massud’s father and torn up by the ignorant US intelligence officer, which celebrates ideas that have travelled over the ages from one part of the planet to another. The characters spend their days on the island sewing page after page back together with a golden thread. Aslam is in many ways a traditional realist: he wanders into the head of one character after another at will. But he’s writing a form of realism in which individual psychology is often secondary to larger symbolic structures and archetypes. He is magician-like not just in conjuring the island but in his general narrative style, because he has the power to magic into being symbolic images and to rescue characters from near-impossible situations. Just when everything seems to be falling apart, the two people who most need to find each other will coincide in an unlikely place, enabling the story to continue.

This isn’t “magical realism”: it’s all within the bounds of earthly possibility, if not within the bounds of credibility. It’s also not the old-fashioned epic romance the title might suggest, because the political sphere depicted is so horribly accurate in its violence and cynicism. If character is secondary to archetype, this reflects the reality of a world in which the individual is frequently secondary to collective ideology.

Ultimately, Aslam doesn’t allow this ideology to triumph, because the consolation offered by both the visual beauty and the coincidences comes in the service of a redemptive moral view. This is a morality in which love, kindness and respect for the individual can and must survive. We’re told that, though Pakistan is so violent, there’s a “deep desire to avoid confrontation”. Ordinary people wish to be left alone, “finding pockets of love and comfort within the strict laws governing them”. The enchanted island is such a pocket given dazzling physical form, as is the glass museum where Imran briefly finds refuge.

Evil here is not innate. Nargis’s uncle sees it as “another word for stupidity, for not knowing what really mattered in life”. In the face of this, there’s a collective spirit that makes its way across the country, enabling a communality of the good or the sane. It’s this that makes reading this exquisite, painful book not merely bearable but exhilarating, as it counters the despair with hope.

• Lara Feigel is the author of The Bitter Taste of Victory (Bloomsbury). The Golden Legend is published by Faber. To order a copy for £13.93 (RRP £16.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.