Disney has reinstated James Gunn to write and direct “Guardians of the Galaxy 3,” an individual with knowledge of the project told TheWrap.

Gunn was fired from Disney’s “Guardians of the Galaxy” franchise last July after online critics discovered years-old tweets in which he joked about rape and pedophilia. Gunn apologized and said he had grown as a person in the years since the jokes. Despite calls from many fans to reinstate him, Disney made clear at the time that Gunn would not direct the third “Guardians of the Galaxy.”

Disney said in a statement from Walt Disney Studios Chairman Alan Horn that the jokes were “indefensible and inconsistent with our studio’s values.” According to an individual with knowledge, the decision to rehire Gunn was made months ago following conversations.

Also Read: James Gunn in Talks to Direct 'The Suicide Squad'

Gunn said in a statement on Twitter Friday, his first tweet back since his firing, that he is “always learning.”

“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,” Gunn said Friday 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. 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.”

In January, TheWrap reported that Gunn was in talks to direct “The Suicide Squad” for DC. The sequel to 2016’s “Suicide Squad” will hit theaters on August 6, 2021, Warner Bros. announced Wednesday. Peter Safran and Charles Roven will produce. He will complete this film first, with production to start in September, before returning to Disney for “Guardians 3.”

As TheWrap first reported, Gunn wrote the script for “The Suicide Squad.” The film is said to have a completely new take on the property, in which DC supervillains are recruited by the government to carry out secret missions too dirty for the likes of Superman and Batman.

The “Guardians of the Galaxy” franchise has made over $700 million at the box office, with the last installment scoring an opening weekend of $146 million two years ago. Both films were highly praised by critics and fans alike.

Also Read: Will Smith Exits James Gunn's 'Suicide Squad' Sequel

Dave Bautista, who plays Drax in the “Guardians” films, was vocal about Gunn’s firing. Bautista tweeted that it was “pretty nauseating” working for Disney after it empowered “a smear campaign by fascists #cybernazis.”

“It’s a bitter-sweet conversation — um, no it’s a bitter-bitter conversation because I’m not really happy with what they’ve done with James Gunn,” Bautista said on “The Jonathan Ross Show” last August. “They’re putting the movie off. It’s on hold indefinitely. To be honest with you I don’t know if I want to work for Disney.”

Deadline first reported the news.