In 1996, The X-Files released what would become one of its most notorious episodes. Inconspicuously titled “Home,” the episode follows paranormal detectives Dana Scully and Fox Mulder as they investigate the murder of an unidentified baby on the outskirts of a small Pennsylvania town. Their search quickly leads them to the Peacocks, a family of three deformed brothers, who appear to live alone on a farm, cut off from the rest of the world. Eventually, Mulder and Scully discover the brothers’ horrifying secret: their quadruple amputee mother, previously presumed dead, and responsible for giving birth to the murdered child.

Today, the episode is remembered as one of the most disturbing X-Files episodes of all time (Fox promised to never air it again after complaints of it being "tasteless")—though it's also a fan favorite. But what many viewers on either side of the argument might not know is that it was partially inspired by a truly surprising source: Charlie Chaplin's autobiography.

Chaplin, who grew up poor in London, got his first big break playing a small part in a British theatrical production of Sherlock Holmes. The teenaged Chaplin toured the countryside with the theater troupe, and would seek out the cheapest lodging during his stay in each town. In My Autobiography, Chaplin describes a particularly strange stay at a miner’s house in a “dank, ugly” town called Ebbw Vale.

One night, after dinner, Chaplin’s host led him into the kitchen, announcing he had something to show the young actor. From a kitchen cupboard—where he was evidently sleeping—out crawled a man with no legs who, at the miner’s goading, began performing a series of strange tricks and dances. In the book, Chaplin recalls:

A half man with no legs, an oversized, blond, flat-shaped head, a sickening white face, a sunken nose, a large mouth and powerful muscular shoulders and arms, crawled from underneath the dresser … "Hey, Gilbert, jump!" said the father and the wretched man lowered himself slowly, then shot up by his arms almost to the height of my head. "How do you think he’d fit in with a circus? The human frog!" I was so horrified I could hardly answer. However, I suggested the names of several circuses that he might write to.

The incident shocked Chaplin—and its retelling apparently had a strong impact on The X-Files writer Glen Morgan as well. According to Morgan, who co-wrote the episode with James Wong, Chaplin's story came back to him while he was writing "Home." Though Morgan mis-remembered the anecdote slightly—he recalled the man being totally limbless, and that the family members "[stood] him up and start[ed] singing and dancing, and the kid kind of flop[ped] around"—the general image stuck with him for a long time. “I think I read that like 13 years ago, and ever since then I thought, 'God, I gotta do something like that!,’” Morgan later explained [PDF]. So he modeled the mother of the Peacock brothers on the legless man under the dresser. Hidden under a bed for most of the episode, Mama Peacock served as the final twist in one of The X-Files' most controversial episodes.

You can see co-writer Wong discussing the episode—and Chaplin's influence on it—in the video below.