James Gunn was fired Friday as director of "Guardians of the Galaxy Vol. 3" because of old tweets that recently emerged where he joked about subjects like pedophilia and rape.
Walt Disney Studios Chairman Alan Horn announced the removal.
"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," Horn said in a statement.
Gunn has been writer and director of the "Guardians of the Galaxy" franchise from the start, taking an obscure Marvel Comics title about a group of multicolored misfits and turning it into a space opera decked with comedy and retro music that made Chris Pratt a major movie star. Through two installments the franchise has brought in more than $1.5 billion in global box office.
Gunn apologized for the old tweets Friday after his firing, echoing similar sentiments he expressed on Twitter a day earlier.
"My words of nearly a decade ago were, at the time, totally failed and unfortunate efforts to be provocative. 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," Gunn said in a statement. "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."
Gunn's current Twitter account is heavy on left-leaning politics, and some on the right with whom he'd sparred found and promoted the tweets from 2008 to 2011 that led to his firing.
Disney did not announce a replacement director for "Guardians of the Galaxy Vol. 3." Gunn had been writing the script and it's not clear how far along he was or whether new writers will be brought in. Marvel Studios has not announced a release date, though Gunn had said 2020 was the target.
Marvel has staked a lot on the third "Guardians" movie. Gunn has said the film would end the current iteration of the Guardians of the Galaxy and launch another decade, or more, of Marvel films.
In addition to Pratt, the "Guardians" franchise stars Zoe Saldana and Dave Bautista, and features the voices of Bradley Cooper and Vin Diesel.
The characters also were an essential part of this year's Disney and Marvel megahit "Avengers: Infinity War."
Fans at Comic-Con in San Diego said they disapproved of Gunn's tweets, but were mixed on how they felt about his firing.
"It's unfortunate to hear and makes me question whether I would see a movie like that even without his creative involvement," Mario Panighetti of Mountain View, California said.
Joanne Renda of Toronto said, "It's never really funny to joke about that stuff, but copping to it is the first step. Everyone deserves a second chance. It's kind of crazy our culture today, firing people right away."
AP Film Writer Lindsey Bahr contributed to this story from San Diego.