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," Mr 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 multicoloured misfits and turning it into a space opera decked with comedy and retro music that made Chris Pratt a major movie star.
Through two instalments the franchise has brought in more than $1.5 billion in global box office.
He was slated to direct the third movie of the franchise before his firing.
Gunn apologised for the old tweets on Friday after his firing, echoing similar sentiments he expressed on Twitter a day earlier, and denied having ever engaged in the behaviour mentioned in the tweets.
"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.
The tweets were found and promoted by alt-right personality Mike Cernovich, who is known for promoting conspiracy theories like Pizzagate.
Mr Cernovich shared the tweets with his 422,000 followers and urged them to contact Disney.
Gunn's current Twitter account is heavy on left-leaning politics, and he frequently spars with right-wing personalities.
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.
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."
More about: Disney