Published over 75 years after its completion, Ivor Gurney's Rewards of Wonder remains for me one of the finest volumes of poetry of the last century - and also one of the quirkiest. Many of the poems are repeated in lightly altered form, usually bearing the same title; they are like refrains in music (Gurney was a composer long before he was a poet). Obsessional subjects - clouds, Gloucestershire, Ben Jonson, certain places on the Western Front (Laventie, Arras), tobacco, London, Romans, hedgerows - recur too many times to be merely a matter of art, although the final effect is one only art at the highest pitch can offer. Sentences unfold like complicated flowers; an intensity of tone sits with a gentleness; the lyric voice is simultaneously detached and intimate, but nothing can really explain the intoxicating effect on the reader.

Rewards of Wonder is avant-garde despite itself. It helps to follow the book right through, as with a novel or a symphony: patterns recur and memories of phrases are reawakened with the repeated poems. You come away with your vision displaced, and the world temporarily askew, not quite what it was.

In 1922, the same year that the 32-year-old Gurney (the son of a Gloucestershire tailor) was admitted to the City of London Mental Hospital in Dartford, where he remained against his will for the remaining 15 years of his life, he submitted a typescript to Sidgwick and Jackson, who refused it - as did a succession of publishers. His first review, by Sir R Forbes Roberts, was on the wireless - except that it wasn't. The "wireless of praise" was imaginary, his belief a symptom of his mental illness, diagnosed since as being either severe manic depression or schizophrenia. Meanwhile, he was revising the poems in longhand in the original hardback exercise books, thus adding a layer of complication that deepened when, six years after the poet's death in 1937, Vaughan Williams - tutor to Gurney at the Royal College of Music in 1919 - decided to have the "revised" typescript copied by "a very good typist in Dorking", discarding the originals in the process.

Even good typists make errors. For this critical edition, the surviving originals were consulted by the editor, George Walter. The textual notes are almost as fascinating as the poems themselves, with crossed-out yet still legible false starts and drafts and variants, adding another dark seam to the archaeological record. The suicidal patient may have believed he was Beethoven and written nonsense letters to Baden Powell, but to friends he could still complain lucidly of "damned misprints alterations" in his typed-out poems, often amounting to something as minor - but crucial - as a missing hyphen.

If Ivor Gurney was unlucky in his life, he was lucky with his friends, particularly the composer Gerald Finzi and his wife Joy, and the violinist Marion Scott, who was in love with him and who instructed the asylum staff to send her everything Gurney wrote. Edmund Blunden, Herbert Howells and Vaughan Williams believed he was a genius, both as composer and poet. It is only thanks to such friends and to post-mortem fans that the bulk of Gurney's work survives at all, much of it held in the Gurney Archive in Gloucester.

Walter, like P J Kavanagh in his magisterial Ivor Gurney: Collected Poems, suggests that the composing of poetry - not just the initial effusion, but the tireless reworking and revising - was a means of drowning out Gurney's auditory hallucinations, and cites a paper in the British Journal of Medical Psychology that suggests "the poetic function of language is less impaired than other functions" in certain psychotic individuals. This is fairly extraordinary, as it suggests a separate "bundle" in the brain for poetry. Playing the piano also helped.

Gurney, as a short-sighted private in the 2/5th battalion - the Gloucester Regiment - had to clear battlefields of the dead and wounded, was wounded, gassed and probably shell-shocked, yet felt survivors' guilt. This experience of horror did not make him mad, as he was showing signs of "neurasthenia" (nightwalking, paranoia, insomnia) as early as 1913, but they clearly exacerbated his condition. Treatment was perfunctory and, in many cases, counter-productive. Hell and death feature strongly in Gurney's work, and it is not hard to see why: he dreamed only of escape.

The Collected Poems divided Gurney's work into pre-asylum and post-asylum, but Rewards of Wonder shows the reality to have been much more complex. He began the bulk of it in 1921, before he was incarcerated, and continued working on it for the next three years. Despite Gurney's deep debt to the ecstatic flow of Walt Whitman, the way the book was organised is eccentric or original enough to make it a direct product of his asylum state: its success as art is so complete, however, that it raises many questions about the inter-relationship of art, suffering and insanity.

One of the revelations of the Collected Poems was just how good previously unpublished poems were. "Farewell", for instance, discovered "loose, on lined paper", with a stanza written sideways on the margin and the last three lines scribbled on the back ("You dead ones - I lay with you under the unbroken wires once") is a major war poem, composed in the asylum, and previously unknown. The revelation of Rewards of Wonder, by contrast, is in watching the harmonics of the poetic voice work through and over the varying subject-matter, so that the poems about the "Thud, smack and belch of war" strike chords with or fold into the peacetime poems celebrating Gurney's beloved Gloucestershire, and make the former even more poignant. The drawback of corralling the "war poets" into the same fold is that it fractures the poetic continuum. You forget these men were not always soldiers, that they were first and foremost civilians caught in history's machinery: Gurney still thought of himself as a civilian, even in the trenches.

And it was not all horror. Unlike Wilfred Owen, he was happy to record moments of "great sweetness felt in mere living" in a candid, almost boyish voice, which is perhaps why, despite a considerable revival of interest in his work over the last 20 years or so, he is neglected as a war poet. The haven of straw in a barn after "sorefooted weeks"; the beauty of "Summer shimmer there and Autumn mists / Seen from trenches of red soil"; the ecstasy of a cigarette, all play the full paradoxical range of extreme experience.

Gurney was extreme in his own personality, poisoned by his illness. He had a fierce temper, a severe eating disorder, and was obsessed by physical exercise: highs and lows alternated with unpredictable ferocity. It is hardly surprising that his poems have curious fracture lines, recalling Shakespeare's later work, as if sense has been sharply knapped by a sudden violence of thought. A much-anthologised poem, "To His Love", has the most curious visual fracture of all. An elegy to an early friend killed in action in 1917, it has been interpreted - despite Gurney's heterosexual attachments - as a gay love poem. The last stanza, backing off from the body's mutilation or wound, has a startling enjambement: "Hide that red wet / Thing I must somehow forget." Gurney has made it dramatically unforgettable, of course, by juxtaposing the most blurred word in the lexicon with a sensual particularity, and giving that blur an unnatural weight. Listen to the extraordinary shifts of thought in the opening lines of the poem "Strange Hells" from Rewards of Wonder: "There are strange Hells within the minds War made / Not so often, not so humiliatingly afraid / As one would have expected - the racket and fear guns made ..." This is both private rumination and public address, perfectly poised and surprising and supple; it interrupts its own grandiosity, its temptation to strike a pose. That first rather portentous line is scarcely off the tongue before the little fellow at the back puts up a finger and objects: not quite as bad as we expected, actually. And then slap-bang back to the reality, but sieved through a real complexity of response: the horror of the shells. In three lines we have it all: courage despite oneself - still surprised by it; and fear; and then the inner echoing after-time. In revising the poem, Gurney replaced six complex lines by that one line beginning "As one would have expected", with its touching conversational detachment and its intimacy. An elliptical stroke of genius.

And yet the more one reads these lines, the more other meanings assert themselves. Why "minds" and not "mind"? Is the object of 'War made' the hells, or the minds? Or both at once, the inner war-torn mind being Hell, anyway? Gurney's run-on, Elizabethan-like syntax makes multiple readings possible. The rhyme dares to repeat the same word ("made"), like a folksong, or like an obsessive memory, a recollection in trauma. The memory of the noise and the noise itself become one, heightened by the ensuing account of the Glosters' first experience of bombardment, which they tried to drown in song. By the end of this miraculous small space of sonnet, we have moved forward to a glimpse of the survivors "on State-doles, or showing shop-patterns / Or walking town to town sore in borrowed tatterns / Or begged". (It's the dialect rags that are "begged", not the veterans - a typically elastic use of grammar.) And then the magnificent closing line, again using his favourite device of close repetition: "The heart burns - but has to keep out of face how heart burns." This is dangerous stuff, and exhilarating.

Gurney, in the asylum, thought of himself as England's "first war poet", and this delusion was considered a symptom of his insanity. My hunch is that he knew he had a decent claim to be so titled, it was just that very few understood him. He is certainly, with David Jones, one of the first poets in English of the last century. As Gurney was also a composer, so Jones was a painter, and a great one: this may have been to their disadvantage in a country that likes to place an artist into a single neat box. But they were also outsiders, despite their well-placed supporters; visits to the incarcerated Gurney were "unbearable", so lucid was he in his mental and physical isolation and despair.

Solitude, even loneliness, is the hallmark of his poetry; despite his capacity for friendship, only his comrades in the trenches are celebrated. Otherwise, he is alone with the landscape, frequently "dim" at dawn or dusk; with the skies - the "all starry air-tide there"; with the submerged past of Briton, Roman or Dane; with an England deepened by inspirational or transporting spots of time. This makes him sound conservative, a Georgian even, but the oddity and quicksilver manner make him resolutely modern, even anticipating an American modernist like John Ashbery. He goes even further with adverbial constructions than Shakespeare or Whitman, but it works. And the pain in the poems is not always obvious. "The sick mind grows whole in ..." What? "October gales", of all things.

He argues it over with himself in "June's Meadows". "Swathes laid breaker like in long shore waves, / And gleaming with dew's fall of the middle night" recall, oh dear, "the Golden Age", but afraid of becoming an "antiquary" he must "hide the thought close". That seems to me very true; we feel through landscape that epiphanic moment of beauty in our spirit, but the mind creases it into nostalgia, then a fear of sounding deluded or sentimental. Perhaps this kind of intense candour made Gurney mad, or madness made him candid. Either way, the reward for reading Ivor Gurney is, indeed, wonder.

· Rewards of Wonder: Poems of Cotswold, France, London by Ivor Gurney edited by George Walter is published by MidNag/Carcanet, price £9.95