Gillian Anderson has confirmed that she is to play Margaret Thatcher in the fourth series of The Crown, the hit Netflix drama. Anderson, said she was “falling in love” with the “complicated and controversial” character of Thatcher.

Rumours had swirled that the former X-files star would be cast as Britain’s first female prime minister.

The actor, who is interviewed in the Observer magazine, grew up in London, but left the same year Thatcher came to power.

Anderson said: “I am so excited to be joining the cast and crew of The Crown and to have the opportunity to portray such a complicated and controversial woman. Thatcher was undoubtedly formidable, but I am relishing exploring beneath the surface and, dare I say, falling in love with the icon who, whether loved or despise, defined an era.”

In an interview with the Observer magazine being published online on Sunday, she says falling for the character you are playing is helpful. The fascination lay in drawing a line from the prime minister’s early years in a Grantham grocery. “Just everything that came later stems so entirely from her childhood … I am not going to use the word ‘forgivable’, but one can find compassion,” Anderson says.

Olivia Colman will take to the throne as the Queen in the third series, replacing Claire Foy, while Helena Bonham Carter replaces Vanessa Kirby as Princess Margaret.

Tobias Menzies will take over playing Prince Philip from Matt Smith, while Josh O’Connor will play Prince Charles and Killing Eve writer Emerald Fennell will play Camilla Shand, now the Duchess of Cornwall.