Here’s a gothic tale for a stormy night: a man called Meredith converts a room in his house into a cluttered and untidy study, and one day asks a visiting friend if he can see anything strange on the ceiling.

“Don’t you see it?” he said.

“See what?”

“The – thing. The woman.”

I shook my head and looked at him.

“All right then,” he said abruptly. “Don’t see it!”

This is the beginning of a newly discovered HG Wells ghost story, called The Haunted Ceiling, a macabre tale found in an archive that Wells scholars say they have never seen before. It will be published for the first time this week, in the Strand magazine.

The story was discovered when Andrew Gulli, editor of the Strand, heard that the University of Illinois held a substantial archive of Wells’s works. He promptly hired an assistant to photocopy hundreds of manuscripts and sorted through them to see if he could find something new.

“Initially, from the titles of the manuscripts, I thought I happened upon lots of unpublished works, but those thousands of pages were narrowed down to this delightful story,” Gulli told the Guardian.

He called it “a vintage Wells story – you have a supernatural event, characters with two schools of thought on the event, [and] the literary type versus the scientist. This reminds me of his story The Red Room, but we have a more of a twist with The Haunted Ceiling.”

Wells scholars have dated the story to the mid-1890s, when the author was about 30. This would mean that he wrote The Haunted Ceiling around the same time he produced his more famous ghost tale, The Red Room, which depicts a sceptic’s terrifying night attempting to discredit claims a castle room is haunted.

While most famous for science fiction books like The Time Machine and The War of the Worlds, Wells frequently wrote gothic tales about doubters confronted with supernatural events, often leading to ambiguous and haunting endings. Stories like The Story of the Inexperienced Ghost, in which a man relates an occult encounter, then becomes more agitated until he collapses and dies. The narrator observes: “Whether he did indeed pass there by that poor ghost’s incantation, or whether he was stricken suddenly by apoplexy in the midst of an idle tale – as the coroner’s jury would have us believe – is no matter for my judging.”

The Haunted Ceiling is so obscure that two Wells scholars, Patrick Parrinder and Michael Sherborne, told Associated Press that they had never seen it before. Comparing the style and content to other Wells stories, they dated it to around 1895: a time when ghost stories were popular and Wells was both prolific and strapped for cash.

“So the puzzle is, why was this one either never sold, or if sold never published?” asked Parrinder, while Sherborne called it “not one of Wells’s very best stories, but it is a skilfully assembled anecdote which would, I think, be very effective as a self-contained magazine item.”

Gulli added: “The reason we released it now is to keep up the tradition of having ghost stories read during the cold months and during the holiday. There is something very cosy about it: the old house, the main characters playing chess and discussing this odd ceiling, but at the same time you have something very macabre and unsettling.”