LOS ANGELES — Disney is taking back James Gunn, the creative force behind its “Guardians of the Galaxy” movie franchise, reversing its contentious decision in July to fire the filmmaker for offensive jokes he wrote on Twitter several years ago.
The tweets by Mr. Gunn, who wrote and directed the Marvel superhero film “Guardians of the Galaxy” in 2014 and delivered a smash sequel in 2017, contained jokes about pedophilia, AIDS, rape and the Sept. 11, 2001, attacks. Two far-right provocateurs, Mike Cernovich and Jack Posobiec, threw a spotlight on the comments — written between 2009 and 2012 — after Mr. Gunn harshly criticized President Trump online.
Disney executives seemed to acknowledge on Friday that they made a misstep of their own in almost immediately firing Mr. Gunn in the aftermath: At the time, “Guardians” cast members condemned the decision as an overreaction to the “mob mentality” of the internet. If nothing else, the reversal reflects the challenges that Hollywood studios face as they contend with online furors over past behavior in response to the #MeToo and Time’s Up movements, all while trying to protect billion-dollar film properties.
Walt Disney Studios revealed Mr. Gunn’s reinstatement as the director of “Guardians of the Galaxy 3” in an article on Deadline.com, a trade news site. Disney declined to comment further, except to confirm the report’s accuracy. In a statement on Twitter, Mr. Gunn called himself “incredibly humbled” and “tremendously grateful” to those who had supported him in recent months.
“I am always learning and will continue to work at being the best human being I can be,” he wrote. “I deeply appreciate Disney’s decision.”
Alan F. Horn, chairman of Walt Disney Studios, decided to rehire Mr. Gunn — several months ago — after a series of meetings with the director. Mr. Horn, who reached out to Mr. Gunn, had been impressed with his public apology on the day Disney fired him. Mr. Gunn repeatedly took responsibility for his words, which he called “stupid, not at all funny, wildly insensitive and certainly not provocative like I had hoped.”
“Regardless of how much time has passed,” he had added, “I understand and accept the business decisions taken today.”
Mr. Gunn’s response stood in contrast to how other stars have reacted in similar situations. Kevin Hart, for instance, was initially defensive when his past anti-gay comments on Twitter resurfaced in December after he was named host of the Academy Awards telecast. Mr. Hart did not apologize at first, instead posting a video online in which he said: “Guys, I’m almost 40 years old. If you don’t believe that people change, grow, evolve as they get older, I don’t know what to tell you.”
Six hours later, he stepped down as Oscar host and offered a perfunctory apology.
It was unclear to what degree Disney was influenced by blowback from “Guardians” fans over Mr. Gunn’s ouster. Hundreds of thousands of people signed a Change.org petition asking Disney to reconsider.
“Guardians of the Galaxy” is a crucial property for Disney. The first two movies, starring Chris Pratt as Star-Lord and Zoe Saldana as Gamora, and featuring fan-favorite creatures like Groot and Rocket raccoon, collected roughly $1.6 billion at the global box office. Disney also sells “Guardians” merchandise and is counting on an expensive new “Guardians” attraction at Epcot in Florida to sell theme park vacations.
Fans greeted Mr. Gunn’s official return to the Marvel universe with euphoria. Mr. Cernovich, for one, was not happy. The far-right blogger, author and YouTube personality wrote on Twitter, “If you think Gunn getting rehired hurts me rather than children, you’re a sick person and part of the problem.” He then linked to “An Open Secret,” a documentary about pedophilia in the film industry.