Waters talking about William Castle in 2011. Still via Jeffrey Schwarz/YouTube.

Chalk up another campy TV appearance for Baltimore’s John Waters.

The Baltimore filmmaker on Sunday portrayed one of his favorite directors, William Castle, on the FX series “Feud: Bette and Joan,” which recounts the ongoing feud between movie star rivals Bette Davis and Joan Crawford.

In the episode that aired last night, Waters gets his head chopped off by actress Jessica Lange, playing the character of Joan Crawford, who in turn played the villain of Castle’s 1964 horror film, “Strait-Jacket.”

Waters opened the show by appearing in silhouette, the way Alfred Hitchcock did on his programs. He was portraying Castle, standing on stage in a theater and about to introduce Joan Crawford for a promotional screening of “Strait-Jacket.”

“Good evening, my murderous minions,” he says to the audience. He then tells them “Strait Jacket” is “the most realistic portrayal of an ax murderer in motion picture history.”

Just as he is about to introduce Lange, as Crawford, he says something has gone terribly wrong.

“Oh no! Don’t panic, but a mad woman is loose in this theater,” he warns.

Suddenly Crawford emerges from offstage, in a red chiffon gown, wielding an ax. She approaches Castle, who runs behind the stage curtain. The audience sees him in silhouette again, cowering before Crawford, begging, “No, no, no, please.”

Crawford, also in silhouette, swings her ax in his direction. The audience sees a head bounce on the floor, and then roll down the stage, out from the curtain.

The next thing they know, Castle and Crawford are standing together, taking bows and gleefully tossing souvenir axes into the audience. Crawford encourages everyone to “enjoy a refreshing Pepsi Cola at the refreshment stand.” And that was the scene.

Waters was credited as a special guest star in the episode, but his role was kept secret until several days ago. His admiration for William Castle, however, has never been a secret. He talks about how much Castle influenced him during his one-man shows. He wrote about him in “Crackpot,” saying “I wish I were William Castle,” and paid homage to the director in “Cecil B. Demented” (2000) by turning him into a tattoo.

Waters especially loved Castle’s movie, “House on Haunted Hill,” saying it’s one of the first times the exterior of a modern home (the 1924 Ennis House, designed by Frank Lloyd Wright) has portrayed a haunted house instead of a spooky old mansion.

That’s what made the director of “Feud” want to cast him as Castle.

Tim Minear, director and co-writer of the episode, told the A.V. Club that, in doing research for the episode, he noticed how much Waters admired Castle and decided he would be ideal to play Castle in the episode.

“I wrote the scene, and we were sitting around going, who would be a great cameo to play William Castle?” Minear was quoted as saying. “In part of my research of William Castle I kept finding John Waters talking about William Castle. What I discovered was [that] John had actually been in the audience of one of the screenings of that tour, where Castle took Crawford around for Strait-Jacket. So he saw it in real life.”

Asked what Waters was like on the set, Minear said, “He was just super gracious, and he was there to play.”

Waters told IndieWire he was pleased to be in the show.

“It was an honor to be asked to do it, because I’m such a fan of William Castle,” he was quoted as saying. “I had to keep the secret for so long because we shot it a long time ago. And the secret kept. I was surprised, because there were 100 extras there.”

Castle was much heavier than Waters is, but that wasn’t an issue with the producers.

“When they asked me to do it, I was like, ‘Well, I’m not fat, should I wear a fat suit?’ and they were like, no, we just like the conceptual idea of you playing him,” Waters told IndieWire.

Waters said he first saw “House on Haunted Hill” when he was growing up in Baltimore.

“When I first saw ‘House on Haunted Hill’ as a kid in Baltimore and the skeleton went out on the wire and the thousand kids in the audience went crazy … My whole life, I’ve tried to at least equal that cinema anarchy. I came close with the end of ‘Pink Flamingos,’ but I didn’t tie with it. He still beat me.”

The “Feud” episode was called “Hagsploitation.” It was about using washed-up actresses to star in horror films. “Take a beauty queen of yore and make her suffer,” said actor Stanley Tucci on the show, playing producer Jack Warner of Warner Brothers.

Last night’s episode also featured a reenactment of one of Bette Davis’s most famous lines about Crawford: “I wouldn’t piss on her if she were on fire,” said Susan Sarandon, playing Davis.

Ed Gunts is a local freelance writer and the former architecture critic for The Baltimore Sun.