Decoded. By Mai Jia. Farrar, Straus and Giroux; 315 pages; $26. Allen Lane; £18.99. Buy from Amazon.com, Amazon.co.uk

FINALLY, a great Chinese novel. The past 35 years have seen an outpouring of fiction in China, only a small fragment of which has been read overseas. Much of this literature has been pored over and acclaimed for the insight it offers into a country so newly influential. There have been good books, of course—some provocative or sensationalist, many bravely political. There have even been two Nobel prize-winners. Yet almost none of the thousands of translated works has held its own as a novel that book-lovers with no special interest in China will relish.

“Decoded”, the debut work of Mai Jia, breaks the mould. Written under a pseudonym by a former member of the intelligence services, it was published as “Jiemi” in China in 2002, and has now been translated into English with great verve and fluency by Olivia Milburn. It stands out among Chinese novels for its pace, liveliness and the sheer novelty of the tale it tells. It grips from the first page.

This is the story of Rong Jinzhen, an orphan who becomes an obsessive maths genius. He is twice adopted before being forcibly recruited into Unit 701, the elite code-breaking unit of China’s secret services. The child Jinzhen counts ants, calculates the number of days that his adoptive father lived and eats pear blossom. As a fragile adult he daubs his walls with multicoloured diagrams and numbers, and is dismissed as a lazy loon until he cracks an elusive code.

The novel is a hunt for the truth about this solitary cryptographer. But “Decoded” is no thriller. An unnamed narrator tries to unravel the mystery surrounding Jinzhen’s fall in the 1960s: one day he makes a simple mistake and in a moment his genius crumbles. The national hero spends the rest of his days in a care home for former spooks.

Those hoping for revelations about China’s secret services will be disappointed. Mr Mai instead illuminates the peculiar psychology of code-breaking: “One genius trying to work out what another genius has done—it results in the most appalling carnage.” The book wears its harsh history lightly. Jinzhen writes a self-criticism for the “feudal superstition” of interpreting his colleagues’ dreams, for example. His bodyguard will shoot Jinzhen if he is threatened, in order to protect his secrets.

This strange, twisting tale is told in fizzy, vivid and often beautiful prose. To break a code is to extend a hand to grasp the sky and hope to catch a bird. Every character is larger than life, including the non-sentient ones: a cipher Jinzhen tries to decode is “singularly freakish and malicious”. The book is flooded with the emotion of wrecked lives, but its expression is taut: Jinzhen cannot endure “the myriad idiosyncrasies of other people”. He falls in love with his future wife, who “appears with no sound, she leaves in silence”.

Mr Mai has been labelled the “Dan Brown of China” because both have sold millions of books, but there the comparison ends. This novel has the expansive sweep of Gabriel García Márquez’s magical realism; like Peter Carey he plunges fully into a new world; his extraordinary protagonist, tender and heartless in equal measure, recalls that of Tom McCarthy’s “C”. Yet Mr Mai’s authority is his own. He plays with the reader: his story, he begs, “hungers to be trusted”, but in the next paragraph he seeks forgiveness for adorning the facts. He offers a beguiling and magical mystery tour of China. It is an absolute joy to read.