Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

James Gunn is heading back to the "Galaxy."

Gunn, who was fired by Disney last year after a conservative publication published offensive tweets from a nearly decade ago, has been reinstated as writer-director of "Guardians of the Galaxy Vol. 3," the next installment in the blockbuster Marvel franchise.

The director's return, first reported by Deadline, was confirmed by his representatives.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"I am tremendously grateful to every person out there who has supported me over the past few months," Gunn said in a message on Twitter. "I deeply appreciate Disney's decision and I am excited to continue making films that investigate the ties of love that bind us all." (Disney, which owns Marvel Studios, did not immediately return a request for comment.)

Gunn, who steered the first two films in the series, was removed from "Vol. 3" last July after the Daily Caller published tweets, posted from 2008 to 2011 and since deleted, in which he made crude jokes about the Holocaust, pedophilia, AIDS and Mexican people.

"The offensive attitudes and statements discovered on James' Twitter feed are indefensible and inconsistent with our studios' values, and we have severed our business relationship with him," Walt Disney Studios Chairman Alan Horn said in a statement at the time.

Gunn, for his part, apologized, saying on Twitter last July that he once saw himself as a "provocateur" when he was just starting out but has since became a "very, very different" person.

"I used to make a lot of offensive jokes," Gunn tweeted. "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."

Gunn's dismissal from the project did not sit well with its stars. "Guardians" actors Chris Pratt, Zoe Saldana, Bradley Cooper, Vin Diesel and Dave Bautista co-signed an open letter pleading for him to be rehired.

The move also drew criticism from commentators who believed Disney was capitulating to bad-faith attacks. Gunn's old tweets were initially resurfaced by the far-right figures Mike Cernovich and Jack Posobiec, who pored over the director's social media history after he criticized President Donald Trump.