James Gunn has been fired as the director of “Guardians of the Galaxy Vol. 3” after a series of offensive tweets were unearthed that made light of such controversial topics as pedophelia and rape. Disney, the studio behind the comic-book franchise, made the announcement in the midst of Comic-Con, the geek convention where Gunn is beloved for his horror work in films such as “Slither” and for the irreverent take he applied to the superhero genre in the first “Guardians” and its sequel.

“The offensive attitudes and statements discovered on James’ Twitter feed are indefensible and inconsistent with our studio’s values, and we have severed our business relationship with him,” said Alan Horn, the studio’s chairman.

Most of the tweets date between 2008 and 2011. In one, Gunn wrote, “The best thing about being raped is when you’re done being raped and it’s like ‘whew this feels great, not being raped!'” In another, he joked that attending a meeting of the North American Man/Boy Love Association (NAMBLA) made him finally feel “…ok being who I am.”

Gunn was contrite on Twitter and sought to explain his remarks, writing, “In the past, I have apologized for humor of mine that hurt people. I truly felt sorry and meant every word of my apologies. For the record, when I made these shocking jokes, I wasn’t living them out. I know this is a weird statement to make, and seems obvious, but, still, here I am, saying it.”

Gunn was originally expected to participate at Sony’s Comic-Con panel, tweeting out a tease that he would be in Hall H at the time of the event, although it was unclear what he would be hawking. The panel is supposed to present footage from “Venom” and “Spider-Man: Into the Spider-Verse,” neither of which is directed, produced, or written by Gunn. He will no longer be participating, according to an individual with knowledge of the event.

Disney did not announce a replacement for Gunn. The studio has not formally announced “Guardians of the Galaxy Vol. 3” or decided on a release date, but Gunn has made no secret of the fact that Disney was interested in backing another installment. The prior two films, which follow a ragtag group of space adventurers, have collectively made over $1.6 billion globally.

This isn’t Gunn’s first digital era controversy. Six years ago, he apologized publicly for a 2011 blog that was criticized as sexist and homophobic. In an entry titled “The 50 Superheroes You Most Want to Have Sex With,” Gunn speculated that Iron Man could “turn” the lesbian Batwoman into a heterosexual, labeled Gambit a “Cajun fruit,” and called Batgirl, who is a teenage mother in the comics, “easy.” Facing a backlash, Gunn said he regretted making “poorly worded” statements.

RELATED VIDEO: