James Gunn has been fired from 'Guardians of the Galaxy Vol. 3'.

The 51-year-old filmmaker - who wrote and directed the first two installments of the film series - has been booted from the helm of the upcoming movie after offensive social media posts he had made in the past resurfaced online.

Walt Disney Studios Chairman Alan Horn said in a statement: ''The offensive attitudes and statements discovered on James' Twitter feed are indefensible. [They are] inconsistent with our studio's values, and we have severed our business relationship with him.''

Gunn also issued his own statement on the incident, where he apologised for the comments he made in the past.

He wrote on Twitter: ''Many people who have followed my career know when I started, I viewed myself as a provocateur, making movies and telling jokes that were outrageous and taboo. As I have discussed publicly many times, as I've developed as a person, so has my work and my humor. It's not to say I'm better, but I am very, very different than I was a few years ago; today I try to root my work in love and connection and less in anger. My days saying something just because it's shocking and trying to get a reaction are over.

''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. Anyway, that's the completely honest truth: I used to make a lot of offensive jokes. I don't anymore. I don't blame my past self for this, but I like myself more and feel like a more full human being and creator today. Love you to you all.''