Legend has it that in 1830s New Orleans, a doctor’s wife named Madame Delphine LaLaurie, while living in a mansion and enjoying high society, was also a serial killer who tortured her slaves for sport.

Her 70-year-old female cook was chained to a stove 24 hours a day. Other slaves were punished with horrific mutilations, and a 12-year-old girl fell to her death from the mansion’s roof after Madame LaLaurie chased her down while holding a bullwhip.

While these stories might make some of recoil, they inspired “American Horror Story” creator Ryan Murphy to make LaLaurie a character.

His show’s third season, called “American Horror Story: Coven,” centers around a contemporary school for witches, with aspects of the story told in flashbacks to the early 1800s.

Madame LaLaurie is played by Kathy Bates, who, alongside fellow witches Jessica Lange and Angela Bassett, sets the stage for another season of human terrors.

“I have a friend who was a deputy sheriff of Jefferson Parish, and he told me that someone in their department was present around 20 or 30 years ago when they dug up even more bodies around her house— something like 60 bodies,” says Bates, 65, who speaks to The Post from her hotel in new Orleans, where the show is filming.

“At that time, Nicolas Cage owned the house, and he didn’t believe it until the police said, ‘You wanna see the pictures?’ Cage sold the house.”

Bates, no stranger to horror roles, having won a 1991 Oscar for playing obsessed fan Annie Wilkes in “Misery,” says that the character’s cruelty was not diluted from the legend.

“I’m having a delicious time,” says Bates. “It’s like playing the biggest organ in the world. You get to pull out all the stops.”

“Even when Kathy’s evil, she’s eminently watchable, and you find yourself rooting for her,” says executive producer Tim Minear. “What’s really great is how hilarious she is. She makes you feel for Madame LaLaurie like nobody else could.”

For Bates, this juicy role is all the more interesting due to a possible real-life connection.

“My great-great-grandfather, Dennis Doyle, came over from Ireland to New Orleans in the 1830s, and he became President Andrew Jackson’s doctor,” says Bates. “I discovered the Jackson plantation was next door to [Madame LaLaurie’s family’s] plantation. It gave me a chill that my great-great-grandfather might have crossed paths with her. To think that one of my own blood relatives was even distantly connected to her just thrills me.”

Bates was a logical choice for a show that made its name casting veteran actresses.

Minear makes it clear that this is no accident.

“Ryan loves his award-winning, legendary actresses,” says Minear. “When we decided to do new Orleans and witches, we needed abroad range of broads. We’re creating a show to showcase their talents as well as using their talents to showcase our show. It’s a perfect marriage.”

Having this part is all the sweeter for Bates. She was diagnosed with breast cancer in 2012 — she survived ovarian cancer in 2003 — and this time went public with the news.

“I just decided that people would see me sometimes without breasts,” says the actress, who had a double mastectomy, and was then given the all clear. “I remember seeing Melissa Etheridge with her bald head, just wailing on a guitar at a concert, and I admired her courage. Also, breast cancer is epidemic. Younger and younger women are getting it, and I wanted to help chip away at that stigma.”

Bates has no idea yet if she will become a series regular. For now, she plans to savor every minute of this killer role.

“These kinds of characters don’t fall off trees,” she says. “At my age, I’m just happy to be working, [especially with] women I admire, and I’m really proud to be a part of this epic.”