1:18 PM PT -- James is having one hell of a Friday, it's also been confirmed that he will direct the next "Suicide Squad" film in Sept.

1:04 PM PT -- James just released a statement, saying, "I am tremendously grateful to every person out there who has supported me over the past few months. I am always learning and will continue to work at being the best human being I can be."

"I deeply appreciate Disney's decision and I am excited to continue making films that investigate the ties of love that bind us all. I have been, and continue to be incredibly humbled by your love and support. From the bottom of my heart, thank you. Love to you all."

James Gunn is back in the good graces of Disney and Marvel, because he's being reinstated as the writer and director of 'Guardians of the Galaxy 3' ... TMZ has confirmed.

It's sweet redemption for James, who was fired by Disney last summer over a bunch of old, terribly offensive tweets -- including musings on AIDS, the Holocaust, rape and 9/11.

Our sources say Disney and Marvel honchos decided to rehire James a few months ago, following deliberations and meetings between Gunn and Walt Disney Studios chairman Alan Horn.

We're told Alan reversed course and brought James back into the fold because of Gunn's public apology and general handling of the controversy.

As we reported ... the 'GotG' cast threw their full support behind James after he was canned, and it had to help his plight to get the backing of Chris Pratt, Vin Diesel and Zoe Saldana. The stars vouched for James' character, accepted his apology and hinted Disney only fired him out of fear of public outcry.

James is adding to an already busy schedule ... he's gotta finish up "Suicide Squad 2" before completing the 'Guardians' trilogy.