James Gunn has been rehired as director of Guardians Of The Galaxy Vol. 3 months after previously losing that position over old tweets.

Representatives for the Walt Disney Co and for Gunn on Friday confirmed that he 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 he joked about subjects like paedophilia and rape.

Gunn earlier apologised 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 dismissal 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.

Chris Hemsworth’s Thor hammer to be sold at auction
A helmet worn in Guardians Of The Galaxy (Prop Store/PA)

Gunn has since signed on to write and direct the next instalment of Warner Bros’ Suicide Squad for the Marvel rival DC Comics.

That film is to shoot in the autumn and be released in August 2021.

A Disney spokesman declined to comment on when Guardians 3 might go into production.

The first two films have made more than 1.5 billion US dollars in worldwide ticket sales.

Deadline first reported Gunn’s rehiring.