This tremendously funny, poignant and clever novel is so very good that there is some obligation to set out how and why.

Which isn't easy in a book so seamlessly drawn. At the simplest level, Warner tells the Withnailish story of two young men - aspiring writers, literary dreamers, boozy procrastinators - who first come together in the fifth glorious year of the Thatcher reign in the reception area of a London A&E department.

Douglas Cunningham, a young Scot who is in the process of being thrown out of university and his student flat, is there to keep warm. Llewellyn Smith (think Dylan Thomas played by Richard E Grant) is there because he has burst the sutures that hold him together after heart surgery. They make friends at once, on the basis of a shared passion for writing, and Douglas moves in with Lou and his partner (later wife), Aoife McCrissican, a sometime model, and their baby, Lily.

A strange ménage develops. More drinking than writing is done, though there is a brief opportunity to write captions for the 1986 Cat Calendar and do blurbs for the publisher of Brothel Of The Vampire. Otherwise, giros don't stretch beyond Guinness, porridge and nappies. Douglas grows increasingly obsessed with Aoife, or with her image in a prominently displayed, half-nude fashion shot that sits in the bedroom. He sleeps but a headboard and plaster away from the couple's noisy intimacy.

It doesn't take much prescience to know what is coming. Another model, Abby, provides a wobbly fourth wheel to the set-up. Lou misbehaves. A different stamp of Celt, Douglas disapproves but is drawn in and makes love to Aoife while Lou is elsewhere. Lou's old nan, known as The Apple (Granny Smith), provides further comic relief and a certain moral framework to a story that has a good deal of Catholic business and imagery.

So far, so good, but if it's possible to say this without tumbleweed blowing across the room and a distant church bell tolling, Their Lips Talk Of Mischief is an extended meditation on the nature of fiction and of fictional character. Some of this is at a quite obvious level, aided by the detail that both these young men prefer to speak in literary tags and allusions, and to talk about the nature of art, as when Lou insists "from the first word to the last, the book must be inevitable" and goes on to suggest that "half of art is trying to crowbar in the vagueness of this life". These are clear flags to what Warner is doing, but they are also false lures, for the tender, only half-expected, beautifully suspended ending, with a casually dropped warning of tragedy just a page or so before, is not at all what we're looking for.

It's also clear that the bookish dialogue disguises a more profound level of literary reference, buried in the text. The pink glow of a Lucozade sign over West London - health is a major preoccupation - seems to refer to Italo Calvino's famous 'GNAC' effect, where an obstructed neon advert for cognac symbolises the occluded and partial nature of reality. There is even a seeming reference to the pasty, terrifyingly ordinary devil that Amory Blaine sees in F Scott Fitzgerald's This Side Of Paradise; Fitzgerald standing for hedonism, nostalgia, hopeless yearning and incipient crack-up. These aren't simply Easter eggs for the well-read; they help to drive along Warner's themes.

At still another level, Lou's bloody appearance at A&E (a detail Warner apparently got from Robin Robertson, who has used it in more than one poem) invites us to see him as in some sense heartless, but also as the Sacred Heart, with Aoife iconised as the Holy Mother and Lily, who despite her non-speaking (non-walking) part stands as some kind of redemptive vessel. Never before has a very small child - needy, watchful, a better barometer of mood than the adults - been so strikingly realised in fiction.

Lou's outward amorality is tempered by an engagement with faith that may be sincere or may be as pragmatic as Graham Greene's. It is his way of getting close to the woman he wrongs and abandons. Douglas is the beneficiary of his absence, but as with Nick Carraway in The Great Gatsby, we sense that on the far side of entrancement he is detached and observing, rather coolly for a man who appears to be something of a sexual athlete.

Erotic manners, like clever talk, serve as camouflage in this novel, whose title is completed in the epigraph from Proverbs: "For their heart studieth destruction / And their lips talk of mischief". And yet the catastrophe refuses to descend as we expect it to. Warner's control is uncanny in the final section of the book, which hovers between pathos, humour, deep irony and a genuine uncertainty as to what might follow. Goodness and badness, "roundness" and "flatness" of character are convincingly blurred. Life is not vague, but specific and incomplete, like that cognac sign; belief and Lucozade are competing consolations, both written in the sky. Nothing is crowbarred in, though, and the "inevitability" of Warner's narrative is all in the prose, not in the small, venal or kindly actions it represents. Here's a writer at the very top of his game.

Alan Warner is at the Edinburgh International Book Festival on August 21 at 7pm