Elliot Tuttle knew that “Blue Film,” the fictional story of a camboy who reconnects with a former high school teacher who was fired for sexually assaulting a student, was going to be divisive. After all, it features an empathetic portrait of a pedophile. But he thought some festival would have the courage to screen the incendiary drama. Instead, Tuttle suffered 10 rejections in a row, including hard passes from indie bastions like Sundance and SXSW.

“A lot of the feedback that we got behind the scenes was that it was very polarizing, and it seemed like the powers that be were scared of the movie,” Tuttle says. “It was unbelievable to me. I believe in the quality of the film, and I also had a hard time believing American festivals were this risk-averse.”

Salvation came from the Edinburgh International Film Festival, where the film premiered last summer, receiving overwhelmingly positive reviews. Many critics praised Tuttle for handling such a provocative subject with sensitivity. It will next screen on Oct. 11 at NewFest with more festival dates to come.

“It feels like it kind of took one festival saying, ‘No, it’s OK to program it,’ for lots of other festivals to come on board,” Tuttle says. “I’m still hoping it will find distribution.”

Critics in Edinburgh also heaped praise on Reed Birney, a stage veteran who is a revelation as Hank Grant, a disgraced middle school teacher obsessed with Aaron Eagle (Kieron Moore), his former student who has grown up to become a fetish performer. Grant hires Aaron to spend a night with him. He’s attracted to Aaron, but he also wants more than sex — absolution, understanding, connection — it all becomes so murky.

“It was dark, but it was so well written,” Birney says. “They were such great characters, that I didn’t hesitate for a second about it. Only afterwards, when we were watching it in Edinburgh for the first time with a room full of people, did I get embarrassed.”

Moore, who makes his movie debut in “Blue Film,” had a visceral reaction to the script.

“I was scared,” he says. “But the thing that scared me the most was the idea of watching another actor do it. I felt like I had something that would be worth showing.”

“Blue Film” was a bare bones production. Shot on a micro-budget in a house in L.A.’s Hancock Park neighborhood over 13 days, the filmmakers moved fast to get everything done on schedule. The days were long and Birney and especially Moore spent many of them half-naked. But the hardest part was the two actors’ searing exchanges, in which they share parts of their tortured souls with each other.

“The character things that were more difficult for me than the intimacy stuff,” Moore admits. “The intimate scenes felt like a nice break from some of the dialogue … but making this movie forced me to ask myself, what kind of actor do I want to be? And I want to be a dangerous artist.”

Tuttle drew on his own childhood memories to create a story that clearly represents the kind of dangerous art Moore wants to keep making. He had been watching a lot of films by Catherine Breillat, the French auteur known for her edgy depictions of female sexuality, when the idea for “Blue Film” came to him.

“I was reminded of how when I was in middle school, I really wanted my teacher to have sex with me — like, I really did,” he says. “I had been journaling a lot about that experience, thinking about it retroactively later in my life, and this was kind of a natural extrapolation.”

Tuttle knew the topic of pedophilia inspires passionate feelings, but he was impressed with how “Pervert Park,” a 2014 documentary about a Florida community of convicted sex offenders, compassionately examined its subjects’ lives and inner anguish. He wanted to do something similar with “Blue Film.” But Tuttle and Birney, whose Hank is witty, insightful and guilt-stricken over his aberrant desires, know that many people will condemn them for portraying a pedophile as a human being, not just a monster.

“I will feel empathy for everybody. That’s just the way I live my life,” Tuttle says.

“Nobody chooses to be a pedophile,” Birney says. He did, however, insist that Tuttle make it clear that Hank is not a predator.

“He does not have a computer full of kiddie porn and he hasn’t rounded up kids,” Birney says. “We have a line in there where I say, ‘I know it’s wrong. I’ve always known it’s wrong.’”

Hank’s self-awareness might not be enough to convince skeptical viewers to see “Blue Film” with an open mind. At one of the final screenings in Edinburgh, some audience members made it clear this wasn’t an emotional journey they wanted to take.

“I was sitting in the green room with my mom,” Tuttle says. “And one of our producers was in there watching the film and about halfway through he texted me, ‘Oh, there’s a walkout… and another one… and another one.’ But the Q&A was also lively and there were a ton of hands being raised. So for me, it still felt like a good screening.”