LONDON — Judi Dench is back in the world of espionage – but her latest role is a far cry from James Bond’s unflappable spy chief, M.

In “Red Joan,” to be released Friday in Britain and the United States, Dench plays an elderly British woman whose quiet suburban life is upended when police come knocking to accuse her of passing nuclear secrets to the Soviet Union during the Cold War.

An indignant Joan insists she has done nothing wrong. But as she is questioned, flashbacks reveal a complex tale of love, loyalty and misplaced idealism.

Dench played M in seven Bond films, from “Goldeneye” to “Skyfall.” She says she is fascinated by spies, who are often first-rate actors.

An enduring source of intrigue for Dench is the “Cambridge Spies,” a group of high-ranking British intelligence officers that fed information to the Soviet Union for years. The double agents, who included one-time MI6 counterespionage chief Kim Philby, fended off suspicion with upper-class charm.

“There’s some footage of Kim Philby meeting the press at a flat and saying ‘Of course I’m not (a spy), you’ve got hold of the wrong end of the stick,'” Dench told The Associated Press in a phone interview. “It’s the most wonderful bit of acting you can possibly see.” She recommends the clip to young actors for study.

Directed by stage and film veteran Trevor Nunn, “Red Joan” is based on the true story of “Granny Spy” Melita Norwood, a civil servant living in the London suburbs who passed nuclear secrets to Moscow for decades. When she was exposed in 1999 at the age of 87, she expressed no regrets, saying she would do it all again.

The fictional character of the movie’s title is Joan Stanley. Played as a young woman by Sophie Cookson, she is a bright physics student in wartime Cambridge who becomes involved with the quest for an atomic bomb, and with a charismatic revolutionary (Tom Hughes).

Dench says Joan is convinced she is acting in the name of peace, by “evening up” the nuclear arms race.

“After Hiroshima she said, if everybody had the same armaments, it wouldn’t happen. It would prevent the other side from using them,” Dench said.

Then “she just got on with her suburban life, and it obviously hadn’t occurred to her that it was an act of treason.”

Dench feels some sympathy for Joan’s argument. She can recall the early Cold War years, when the horrors of World War II were still fresh and the prospect of nuclear annihilation seemed all too real.

Dench was 5-years-old when war broke out in 1939 and remembers huddling at the bottom of the stairs as her home city of York in northern England was bombed.

As a young actress, she protested against nuclear weapons, though was never a big political activist like some contemporaries.

“I remember sitting in Trafalgar Square during Ban the Bomb, with Vanessa Redgrave,” Dench said. “I think Vanessa got arrested and had to say to the police, ‘You can’t arrest me, I’ve got a matinee today.'”

Now 84, Dench shows no sign of retiring, though she is picky about the parts she accepts.

“I don’t want to play anybody who is my age and is dropping off the perch,” she said firmly. “The last thing I want to play is somebody who’s being looked after in a care home.”

Her recent work defies typecasting. Dench recently played William Shakespeare’s wife, Anne Hathaway, in Kenneth Branagh’s “All is True.” Next up, she’ll be Old Deuteronomy in Tom Hooper’s big-screen adaptation of the musical “Cats.”

The film offered Dench the chance to make up for a bit of past bad luck. She was cast in the 1981 stage production of Andrew Lloyd Webber’s feline hit, but had to drop out.

“I snapped my Achilles’ tendon, so they delayed the opening,” she said. “And then when we went to the New London (theater) to actually open it, I was in plaster and I fell off the stage. So I knew then that my number was up.

“So it was nice to come back in a circle and be part of it. It didn’t put me off ‘Cats’ for life.”