If you happened to drop by a café in West Hampstead called Dominique’s during 1992, you might well have spotted a quiet American gazing at a laptop through his Harry Potter glasses. Stopping now and then for an inspiration break, there was nothing to suggest that a literary legend was being created by Gregory Maguire, already the successful author of numerous novels for children.

Wicked: The Life and Times of the Wicked Witch of the West was Maguire’s first attempt at “adult fantasy” and, as the writer, who now resides in Massachusetts, explains, the book that inspired the hit Broadway musical was not only born in London but “midwived by the ghosts of the English writers” he loves the most.

“The idea was to write about a character who appeared evil, and I had more or less decided that the Wicked Witch of the West from The Wizard of Oz might serve my purpose,” says Maguire.

So why fly across the Atlantic with his germ of a tale that makes Oz seem unfamiliar, even to Americans brought up on the Frank L Baum stories and the 1939 MGM film? “Oz is an American cultural touchstone, but its roots are solidly in English fantasy writing,” he responds. “Moving to London seemed appropriate: it was like coming to the fountainhead of literary fantasy.”

Maguire recalls how he wrote the first draft of Wicked in West Hampstead, but first hit on the idea while staying in a top-floor flat in Harley Street. “I was quite lonely at the time, but I could look out across Regent’s Park to Primrose Hill and see where 101 Dalmations started out, or to Cherry Tree Lane where Mary Poppins landed. One had a bird’s-eye view of a city crawling with literary magic.”

Maguire’s re-imagining of Munchkinland, the Yellow Brick Road and the two witches, good Glinda and green-skinned Elphaba (her name is a coded reference to L Frank Baum – L-F-Ba), became a global bestseller. But how did the writer react when composer Stephen Schwartz suggested a stage musical version? “I must have looked as if I’d swallowed the mother of all kippers. I peered down my nose and scowled as if to say, ‘The theatre? Is there any such thing?’ But of course inside I was leaping up and down and singing ‘There’s No Business Like Show Business’.”

The first time Maguire watched his parallel Oz brought to life on Broadway was, he says, “tremendously freaky”. “A writer works in intense solitary confinement. Then you go into a theatre and there are 2,000 people watching what you once saw in your mind and buying into it. When I first saw that happen in 2003, the hair on the back of my head curled up. It has never sat down since.”

So does the London production of Wicked, the musical, bring Maguire full circle? “Writing Wicked in London was the way I survived a certain kind of uprootedness from my home territory. Now the show opening here makes me feel very sentimental. Maybe it’s more like a wonderful tying together of a wreath of green laurel.”

Wicked opens on 27 September 2006 (previews from 7 September) at the West End’s Apollo Victoria. Wicked: The Life and Times of the Wicked Witch of the West (£12.99) is published by Hodder Headline.

A version of this article appears in the September issue of What’s on Stage magazine (formerly Theatregoer), which is out now in participating theatres. To secure your copy of future editions, click here to subscribe now.