Like any desert trip, Lawrence Osborne's The Forgiven is alarming and liberating in equal measure. Here is a tale as hot, claustrophobic and gritty as being rolled in the sand after a sweat bath. But it's also a novel with a vast moral horizon, which recedes and advances disorientatingly, leaving the reader with a thrilling sense of vertigo. Written with an untimely elegance more 1930s than 2010s, the book proceeds at thriller pace or, at least, it would if almost every page didn't cause you to fixate on a clinical insight into human nature or a snatch of dream-like description. If it were a film, it would be shot in high definition; every grain of sand would show.

In its opening, The Forgiven consciously echoes Paul Bowles's The Sheltering Sky. Like Bowles's Port and Kit Moresby before them, David, a heavy-drinking doctor, and Jo, a floundering children's author, are a middle-aged couple seeking in Morocco temporary respite from their troubled marriage. Their destination is a remote ksar (castle), owned by their fantastically wealthy gay friends, Richard and Dally, who delight in holding Bacchanalian house parties to the envy and distaste of the locals. _But, on the road at night, disaster strikes. Lost en route - and fortified by a bottle of wine -David panics when his hire car is approached by a fossil-seller. The young man is knocked down and killed. Hours later, the arguing couple arrive at their hosts', where the party is in full swing. In the back seat is the dead youth, the proverbial spectre at the feast.

So the stage is set for a familiar post-9/11 clash of cultures, and for a while that's exactly what the novel provides. As the body is laid out in the stables, icily urbane Richard - a friend of David since their days at public school - negotiates with the police. Ripples of unease circulate through the staff of young boys. Yet the festivities continue, with pirate-themed dances and fairy lights, butter from a single store in the 8th arrondissement of Paris and a galleon made of spun sugar.

Osborne - unsurprisingly for someone who has made a career as a travel and food writer - delights in both the physicality of this excess and its Eurotrashy absurdity. Even at its most austere, The Forgiven often has a twinkle. Take this essentially comic but horrific description of Jo, just hours after the accident: 'There was a look of terror on Jo's face. It had suddenly dawned on her that this was a very elegant party and she didn't know anyone there.' A number of people have compared Osborne to Evelyn Waugh: this is the Waugh of A Handful of Dust, who understands how flimsy the veneer of civilisation can be.

However, with the arrival of the dead man's father, Abdellah The Forgiven subtly shifts into another gear. Grief-stricken, the old man demands that David accompany him with the body back to his village on the edge of the Sahara as a mark of respect. Richard, who claims to know the ways of the Moroccans, assures his friend that he will be safe, and David quickly, if grumpily, agrees. But there are hints that his fate may not be an entirely happy one.

Questions of guilt and forgiveness run through the novel's second half. Will Abdellah absolve David or exact revenge? Can centuries of rage and suspicion be overcome? Nor is it only David who may require forgiveness. The dead boy, we learn, may have his own sins requiring forgiveness, while Jo - taking advantage of David's absence to flirt with an American financier - faces her own moral reckoning. Bringing these strands together, the book builds to a terrific ending. _A thread of fatalism runs throughout, verging on the nihilistic. So often its characters appear prisoners of their upbringings and their cultural assumptions. In one sense, The Forgiven feels a very reactionary book: it proclaims a curse on all our houses, Eastern and Western, an admission that primitive self-interest and centuries-old animosity will generally, if not always, triumph over finer motives. _But that reading alone doesn't credit how much the author makes us care for his flawed characters and their moral gymnastics. Nowhere is this truer, and more surprising, than in the case of the sullen and superficially unlovable David, of whom Osborne memorably observes: 'In the end, he had not done anything wicked. It had just been an accumulation of accidents. One accident after another. Or do we produce our own accidents? Are they the sum total of our little neglects?

That unanswered question sits at the heart of this novel, Lawrence Osborne's second after a gap of 25 years. As unsettling, mysterious and ambiguous as the demonically beautiful trilobite fossils that permeate its pages, The Forgiven presents a compelling riddle of the sands.