The actor made her name playing FBI agent Dana Scully in the sci-fi series, which originally aired from 1993 to 2002 and was rebooted for two more seasons in 2016 and 2018.
She opened up during a Hollywood Reporter roundtable, after fellow actor Cynthia Erivo told how she’d “just broke” after playing Harriet Tubman on screen and couldn’t listen to Aretha Franklin’s music for a while after playing her in Genius.
Anderson said: “I certainly had that experience doing X-Files for nine seasons: I had a good couple of mini breakdowns during that, and at the end, could not talk about it, could not see it, could not see pictures, could not.”
The actor, 52, said she needed to "immerse" herself in theatre in another country afterwards and then after a while she was able to embrace it again.
“But when I started to embrace it, it was almost like I separated myself so much that I was looking at the image as if it was another person,” said the star, who shared the screen with David Duchovny in the hit show. “When you immerse yourself so entirely as we can and we do for such long periods of time, there’s not going to be no consequence to that.”
Anderson is also known for series such as Sex Education and The Fall, in which she starred alongside Jamie Dornan as a detective on the hunt for a serial killer.
Her films include Johnny English Reborn and The Spy Who Dumped Me.
Watch: Gillian Anderson says playing Margaret Thatcher was the hardest role of her career