Receive the latest entertainment-news updates in your inbox

Months after being fired over old tweets, James Gunn has been rehired as director of “Guardians of the Galaxy Vol. 3.”

Representatives for the Walt Disney Co. and for Gunn on Friday confirmed that Gunn has been reinstated as writer-director of the Marvel franchise he has guided from the start. Gunn was fired last July over tweets from nearly a decade ago in which Gunn joked about subjects like pedophilia and rape.

Gunn earlier apologized for the tweets, which he called “unfortunate efforts to be provocative.” Disney Chairman Alan Horn at the time said Gunn’s words were inconsistent with the studio’s values. The comments, made from 2008 to 2011, were brought to light by far-right propagandists Mike Cernovich and Jack Posobiec who combed through Gunn’s social media history after Gunn’s criticism of President Donald Trump.

But Gunn’s dismal was passionately protested by many. Fan petitions circulated online. The “Guardians” cast, including Chris Pratt, Bradley Cooper, Zoe Saldana, Vin Diesel and other stars, supported Gunn in an open letter. “Although I don’t support James Gunn’s inappropriate jokes from years ago, he is a good man,” Pratt said.