The Great God Pan
What is now the first chapter of the novella was published in 1890 in a magazine called "The Whirlwind", while what is now the third chapter of the book was published in the same magazine the following year as a standalone short story called "The City of Resurrections". Machen only viewed the two works as connected after they were finished. Once he decided the two stories were connected, Machen wrote the rest of "The Great God Pan" in a single evening save for its final chapter. Machen did not think of an ending for the tale for months, and in that time believed that the novella would remain unfinished forever. The last chapter was completed in June 1891. Machen sent the novella to the publisher Blackwood, who rejected it, deeming it a clever story that "shrink[s]...from the central idea." It was accepted by John Lane and published in 1894. When published as a book, "The Great God Pan" was accompanied by another Machen tale called "The Inmost Light" which also features a mad scientist and elements of science fiction. The book's cover was illustrated by Aubrey Beardsley.
The Great God Pan
Machen's lifelong fascination with occultism began after he read an article on alchemy in an edition of Charles Dickens's periodical "Household Words" belonging to his father, a clergyman. In his 1922 autobiography, "Far Off Things", Machen wrote that "The Great God Pan" was inspired by the times he visited the Usk, a Welsh river, and the Welsh towns of Caerleon on the Usk and Caerwent as a boy; all of these places had been settled by the Romans. He wrote that "strange relics" were frequently found at Caerwent from the ruined temple of "Nodens, god of the depths". Machen visited the temple, which he described as a "lonely house between the dark forest and the silver river".