Months before “Jennifer’s Body” hit multiplexes on Sept. 18, 2009, writer Diablo Cody had a feeling the edgy horror-comedy would tank. And flop it did, despite the screenwriter taking home an Oscar for her debut film “Juno” a year earlier. Cody easily found a studio to finance “Jennifer’s Body” after the success of the Ellen Page-led teen pregnancy comedy, but the disappointing marketing strategy and pans from focus groups and critics seemed to be a sure recipe for box office collapse. Fast forward a decade, and now, the film is regarded as a cult classic.

“Jennifer’s Body” grossed a lackluster $31.6 million worldwide on a $16 million budget and was significantly beaten out by 2009 horror flicks “Paranormal Activity,” “Zombieland,” “The Final Destination” a remake of “Friday the 13th.” Megan Fox — who became a Hollywood sex symbol after her depiction of Mikaela Banes in the 2007 film “Transformers” — starred, and Cody said that because of her image, defunct distributor Fox Atomic chose to market the film to young men instead of the screenwriter’s intended audience of young women.

Had it been released a decade later, possibly through a streaming service, Cody told Variety that it would have “definitely” found its audience and the themes of queer representation and sexual assault would have been clear.

“Jennifer’s Body” follows Fox as Jennifer Check, a high-schooler who is sacrificed in the woods by a band of power-hungry musicians known as Low Shoulder. The ritual leaves Jennifer possessed by a demon and in order to maintain her strength and beauty, she must feed on boys. Her best friend, Needy Lesnicki (played by Amanda Seyfried), catches on to Jennifer’s hungry habits and tries to keep her boyfriend Chip Dove (played by Johnny Simmons) safe from Jennifer’s sharp-toothed, sludge-spewing jaws.

After the film, director Karyn Kusama struggled to land bigger projects, but she returned to the indie scene with “The Invitation” in 2015, “Destroyer” with Nicole Kidman just last year and with episodes of “Billions” and “The Man in the High Castle.” Cody’s work since “Jennifer’s Body” includes films “Young Adult” and “Tully” with Charlize Theron as well as the Toni Collette-led television series “United States of Tara.”

The cast and crew talked to Variety about the making of the underground favorite for the film’s 10th anniversary.

Before “Jennifer’s Body” hit the big screen, Cody fought with Fox Atomic Studios to market the film to women instead of young boys. She said that she was given the “f— you” by the studio.

Cody: I’m not surprised in the least that it flopped. In fact, I predicted that it would flop months in advance. This movie was extensively focus-grouped which is hell. People hated it. I still have one of the cards. I’ll keep it forever. They screened this movie for young men, of course, and the question was “what would you improve about this movie?” and the guy wrote “needs moar bewbs” [sic]. That’s what we were up against. It makes me sad in retrospect.

Megan Fox (Jennifer Check): A lot of the marketing hinged on “Megan Fox is sexy, come see this movie.” And the movie wasn’t about that. The movie was actually about mis-marketing, about people focusing on something and missing the point, about sexualizing somebody who doesn’t want to be sexualized, about all of these other things, about powerlessness as young girls and women and nobody was ready to hear that.

The rebellious film went on to earn a cult following, and Cody and Kusama also rejected industry standards by refusing to submit to the “glossy” horror movies of the time, instead pulling inspiration from classic horror.

Karyn Kusama (director): I thought a lot about “The Howling,” I thought about “American Werewolf in London,” and then there’s such sly dark humor in “Rosemary’s Baby.”

Cody: Visually, Karyn and I both loved the old giallo Italian films and we specifically were talking about “Carrie,” I remember. Everything about “Carrie,” like the score, the color of the blood, just that wonderful quality that older horror movies had where they felt more grounded in a way that’s ultimately spookier. They didn’t have the gloss that horror films have today and I think we were trying to emulate that vintage feel.

Because of Fox’s “mystique” and Amanda Seyfried’s “wide-eyed wonder,” the two were shoo-ins for the roles of Jennifer and Needy. Cody and Kusama also met with Emma Stone, Lizzy Caplan and Amanda Bynes during casting calls. Smaller roles were given to a pre-fame Chris Pratt and “The O.C.’s” Adam Brody.

Kusama: Man, we read so many amazing actors. I remember seeing a young Emma Stone, a young Lizzy Caplan. But there was just something about Amanda [Seyfried]. She had this complete wide-eyed wonder about the world in her audition and it traveled through her whole performance. As soon as I saw her, I felt like ‘oh, she’s the one.’

Cody: I remember reading a lot of people for Needy. Like, Amanda Bynes I remember. I remember meeting with Emma Stone about it. And then, Jennifer was always Megan Fox. The moment that suggestion was floated [by producer Mason Novick], I think it was unanimous that she was Jennifer and I honestly can’t imagine anybody else playing that part. At the time, she was coming off “Transformers” and there was just this kind of cultural obsession with Megan Fox and she just has that quality. Megan Fox has mystique and I don’t know a lot of people that do.

Before filming, Kusama built the horror hype by inviting the cast to watch “Evil Dead 2” in her hotel room. The cast also played “Rock Band” in their free time.

Kusama: I had the cast over [to my hotel room]. I think it was Amanda, Megan, Johnny Simmons who plays Chip and Kyle Gallner who played Colin. I was able to have my nanny with me so she put my son (who was not even one yet) to bed while we opened a six pack and watched “Evil Dead 2.”

Jason Reitman (producer): What I remember was playing that game “Rock Band.” I think [the game] had just come out because “Guitar Hero” was already a success. We played the living sh-t out of that game. I remember Christopher Columbus was directing a movie up there [in Vancouver] and the cast from both movies, we’d get together and we’d play “Rock Band.”

Because of Fox’s budding success with “Transformers,” the actress had to dodge paparazzi on set. While filming one scene where she swims in a lake after eating her male classmate in the woods, she said that despite the crew clearing the woods of cameramen, one got in and took a photo of her, almost naked, getting in and out of the lake. She broke down and the crew flew her home to recover.

Fox: You’re not supposed to say this about yourself, but I’m really psychic, and I had a pretty strong intuition and I looked exactly in the direction where I could feel the energy and the focus of a stare, of a lens, of a something, coming from the right across the lake and I was like “there’s someone over there.” And so, here we go, I get into the lake, I do the whole scene and then sure enough, I was on set and my agent called and he was like “okay” and I knew by the tone of his voice that something was wrong and he was like “so there was a photographer.”

I broke down because at that point, I just felt so overexposed and I felt so hunted by media, by tabloids. I felt so bullied, also, by just the world in general. The last thing I had that was mine, the last bit of privacy that I had was my body and I didn’t want to show it. I felt so violated even though I was wearing nude underwear and I had little nipple covers on, it was so much more than I ever wanted to give the world. I wanted to keep that for myself and it was taken from me and so I was really devastated. I broke down, I cried.

At the climax of the film, Jennifer corners Needy’s boyfriend Chip in an indoor pool, where she prepares to feed on the frightened teenage boy. Because of the cold Vancouver winter, the special effects team had to install their own heaters. They even set up an inflatable hot tub to keep the cast comfortable.

Kusama: We started looking at indoor pools and found what I’m pretty sure was a juvenile detention center that might have had a pool, which is interesting. It wasn’t in use, and so we managed to transform it. Those were some challenging days just because the characters were wearing long prom dresses and tuxedos and they were in water and sometimes they were on rigs.

Rory Cutler (special effects coordinator): We were in that pool for about four days and it looked scummy to begin with, but there was a lot of organic matter and a lot of vines and stuff that we laid in there. Even filtering it and heating it, it was hard to keep it in a happy place for people for that long.

Fox: They had a little blow-up hot tub for us to go sit in if we needed to. [Amanda and I] used to use the hot tub in between takes and we were in prom dresses and that’s also where I had to wear the fake mouthpiece. It was just long and you’re damp all day wearing a taffeta dress.

Amanda Seyfried (Needy Lesnicki) and Fox had a “romantic relationship” in the film, says Cody. At one point, the two share an intimate kiss on Needy’s bed. Fox said that they were embarrassed by their “chin acne” and the necessary closeups.

Fox: I remember Amanda and I were horrified that we had to make out. Her more so than me. I was slightly more comfortable being able to do it. She was not excited about having to film that scene at all. I remember we were both stressed out because we had chin acne and there was gonna be this micro-close-up of us kissing. [I remember thinking] “They have to paint that out!” I don’t even know if they did, but that was a very stressful scene for the two of us.

After the Low Shoulder band members escape a bar fire in the small town, they unexpectedly become town heroes as false rumors swirl that they saved fire victims. Their pop song “Through the Trees” becomes the town’s anthem of grief and strength. Kusama worked with music supervisor Randall Poster to find the perfect pop song to become the fictional band’s recurring (and at times purposely obnoxious) musical staple.

Kusama: It was really fun to be able to find a song that had an incredibly catchy surface, but that could also be something that eventually Needy ridiculed and is gonna be driven insane by. We found this great band, at the time they were called Test Your Reflex. A lot of people submitted songs to us and they submitted a song and I was like “you know what, this has a lot of potential” and some of [Test Your Reflex] ended up playing members of the band.

Cody: I actually really love the song “Through the Trees.” I literally think that’s f–king best original song-worthy. I kind of hate that it never got its due. The band was supposed to be called Soft Shoulder which I think was better, but that was a pre-existing band.

Despite losing out in the box office, Kusama said that the cult film has found its audience. The cast and crew were disappointed, but many of the director’s favorite titles have suffered the same fate.

Kusama: I guess over the years, people finally connected to it and I’m so happy that they did. Of course it was heartbreaking to see the movie be perceived as a failure when I was so proud of it and I think Diablo was so proud of it and Megan and Amanda and Adam and Johnny, we were all so happy with it. To have it be kind of slammed, of course that’s painful, but I think when I look at a lot of the movies I love, they weren’t considered successes, and that’s ok, you know. It’s really awesome to know that people are rediscovering the film or discovering it for the first time. I’m gonna sound awfully old, but it warms my heart, it seriously warms my heart.