Credit: Francisco Seco | AP

For months, usually around bedtime, the sound of a distant nursery rhyme would drift through a neighborhood in Ipswich, a seaside town in England.

The words were familiar: “It’s raining, it’s pouring; the old man is snoring.”

But it wasn’t soothing. And it wasn’t putting anyone to sleep.

Quite the opposite.

For several residents, the tune was the stuff of nightmares.

“It’s very haunting,” Ipswich resident Alice Randle said in a recent interview with London-based newspaper the Independent.

“People have said it’s like something out of Freddy Krueger,” Randle added, referring to the lead character in the “A Nightmare on Elm Street” horror movies.

The culprit, unmasked last week, was not Krueger nor any other horror villain sporting a spooky jukebox.

But for an arachnophobe, the true miscreant might have be just as frightening.

That’s right: It was a spider.

An investigation tracked the sound to a nearby industrial park, where a speaker system at a unit inside blared a childlike recording of the song. The racket was actually an alarm system, meant to deter would-be trespassers, according to a BBC report.

The alarm was triggered by spiders scuttling across a camera linked to the system, a spokesman for the industrial park told the BBC, which also noted that the alarm system had been “very successful” at scaring off intruders. That spokesman did not elaborate on why the park selected a nursery rhyme for its burglar deterrence.

Park employees told British reporters that they turned the volume down after they became aware of the complaints.

Randle was apparently one of several Ipswich residents who were disturbed and annoyed by the haunting tune that woke them over a period of more than a year.

The local Ipswich Star reported that residents complained repeatedly to their local officials, who eventually responded and tracked down the eerie song’s source.

One woman, whom the newspaper did not name, said she would hear the song throughout the night — sometimes just once, other times again and again for hours.

“It was absolutely terrifying,” she told the Star. “I heard it at all times of the night — 1 a.m., 2 a.m., 4 a.m. — it was sporadic, sometimes it would play once, other times it was over and over. Last week it played for hours; it was just horrible.”

One woman told the BBC that the first time she heard the song it was “the most terrifying thing ever.”

“I went cold and felt sick, and thought, ‘What on Earth was that?’ ” she said.

And for good reason.

The lyrics, like those of many nursery rhymes, are more sinister than the sing-songiness lets on. The rhyme, a version of which was published in 1912, has a rather dark conclusion:

“It’s raining; it’s pouring.

“The old man is snoring.

“He bumped his head and went to bed,

“And couldn’t get up in the morning.”

But the eight-legged ending to this story is more fitting than frightening. Behind this mysterious nursery rhyme was the protagonist of another bedtime lullaby: an itsy-bitsy spider.

Follow the Bangor Daily News on Facebook for the latest Maine news.