James McAvoy says the ending of ‘Dark Phoenix’ had to be changed "a hell of a lot" because of similarities to another superhero film.

The 40-year-old actor portrays Professor X in blockbuster and revealed that the end of the ‘X-Men’ film – which has undergone numerous re-shoots after wrapping up principal photography in October 2017 – was drastically altered as it was too similar to another unnamed film in the same genre.

In an interview with Yahoo! Movies UK, he said: "The end changed a hell of a lot. The finale had to change. There was a lot of overlap and parallels with another superhero movie that came out … a while ago. And we had no idea that we were."

Michael Fassbender – who plays Magneto in the franchise – jokingly added: "They had spies on set, and [they] basically stole our ideas."

James added: "We were basically trawling through the source material it seems."

Although re-shoots on the film were extensive and pushed back the release date of the film, Sophie Turner – who plays mutant Jean Grey who becomes the titular Dark Phoenix – believes it was a "good decision" by director Simon Kinberg.

She said: "I think it’s so much better for the re-shoots. It was just one of those things that was where the third act … you watch the first two acts and the third act just didn’t feel cohesive. We went back and we redid all of the third act, pretty much, and it was such a good decision. The third act is the best part of the movie for me."

The movie follows Jean as she’s transformed into one of the most powerful mutants in the world following a life-threatening rescue mission in space.

Jean soon loses control of her powers and spirals out of control, tearing the X-Men family apart and threatening to destroy Earth.