Director James Gunn has been dropped from Disney’s Marvel franchise “Guardians of the Galaxy” over old tweets.

“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, chairman of Walt Disney Studios, in a statement.

Gunn, the writer-director of Marvel’s “Guardians of the Galaxy” franchise, apologized late Thursday after a series of old (now deleted) tweets resurfaced in which the filmmaker made what he admitted were “offensive” jokes about taboo topics like rape and pedophilia.

Also Read: James Gunn Puts 'Cruel' 'Star Wars' Fans on Notice: 'Go to Therapy'

Gunn frequently tweets about his opposition to President Donald Trump, and thus drew the ire of fans of the president such as right-wing provocateur Mike Cernovich, who began posting a series of old tweets by Gunn, many of which were subsequently deleted.

Online sleuths then dug up dozens of old tweets of the sort Gunn admitted were “offensive,” many from between 2008 and 2011.

“Expendables is so manly I f–ed the s– out of the p-ssy boy next to me,” he wrote in one.

“The best thing about being raped is when you’re done being raped and it’s like ‘whew this feels great, not being raped!'” read a tweet from February 2009.

Yea @benshapiro is an asshole…..yea Star Wars fans need to go to therapy. Ya know, maybe the dog that barks the loudest is the most guilty. Maybe you need Therapy. pic.twitter.com/kH6xp3fNjl — Nobu Terashima (@_Nobu_T) July 20, 2018

“I remember my first NAMBLA meeting. It was the first time I felt ok being who I am,” said another, referring to a notorious group for pedophiles.

And in a tweet from 2011, he teased fans, “I’m doing a big Hollywood film adaptation of The Giving Tree with a happy ending — the tree grows back and gives the kid a b—job.”

Also Read: James Gunn Says He's Finished Writing 'Guardians of the Galaxy Vol. 3'

On Friday, Gunn offered his apologies and said he understood Disney’s decision to fire him.

“My words of nearly a decade ago were, at the time, totally failed and unfortunate efforts to be provocative,” Gunn said in a statement. “I have regretted them for many years since — not just because they were stupid, not at all funny, wildly insensitive, and certainly not provocative like I had hoped, but also because they don’t reflect the person I am today or have been for some time.”

“Regardless of how much time has passed, I understand and accept the business decisions taken today. Even these many years later, I take full responsibility for the way I conducted myself then,” he continued. “All I can do now, beyond offering my sincere and heartfelt regret, is to be the best human being I can be: accepting, understanding, committed to equality, and far more thoughtful about my public statements and my obligations to our public discourse. To everyone inside my industry and beyond, I again offer my deepest apologies. Love to all.”