U.K. writers regularly churn out well-wrought drama series with top-notch casts, and “London Spy” has all the usual things going for it — smart writing, evocative use of locations, an atmosphere of yearning, erudite suspense. And yet there is something singular about this terrific program, a spare, off-kilter intensity that sets it apart from its peers.

The series is lean, enigmatic and not that interested in linear storytelling; it’s a sensitive exploration of emotional truth and of the complexities behind elaborate performances of identity. It’s elliptical and indirect at times — and sometimes a little too enigmatic — but its narrative drive is strengthened by a percolating anger at injustice, fear-mongering and prejudice. This haunting drama becomes more captivating over the course of its five installments, thanks in large part to sensational performances from Ben Whishaw, Jim Broadbent and Charlotte Rampling.

“London Spy” could have gone terribly wrong, given the luridness of its real-life source material: In 2010, a dead man was found locked inside a gym bag in an apartment connected to the U.K.’s security services, and the British press had a field day speculating about the mix of spycraft and sexual practices that may have led to the man’s death.

The good news is, though elements of a similar story are threaded through “London Spy,” creator Tom Rob Smith has not come up with an exploitative, “ripped from the headlines” riff on a tabloid tale. He’s much more interested in what it costs people to be true to themselves, and how easy it is for the powerful to demonize and shame people for what transpires in their personal lives, even in this supposedly more enlightened age. Threaded through this hall-of-mirrors spy story is the deep irony of a government using lies, subterfuge, manipulation and outright persecution to get at — or invent — “truths” that are supposed to protect their citizens.

The fulcrum of the story is Whishaw’s Danny, who, after a late night of partying, encounters Alex (Edward Holcroft), who couldn’t be more different from the dissolute Danny. Whishaw’s character is a warehouse worker living an aimless life, but his instincts and powers of perception come to the fore when something goes awry in his relationship with Alex, a restrained and buttoned-down banker. Jim Broadbent plays Scottie, an old friend who helps Danny when he runs into serious trouble. It would be unfair to say much about Charlotte Rampling’s complicated role, but every one of her scenes with Whishaw crackles with the electricity of skilled performers working at the top of their games.

Given that much of the enjoyment of the opening episodes has to do with the way the series keeps the viewer pleasurably off balance, the less said about the plot, the better. But what gives this drama an exceptional amount of richness and impact is the way that its meditations on reality and identity are tied to Danny’s very concrete emotional concerns. Despite the best and most duplicitous efforts of an array of powerful forces, a desperate Danny continually insists that whatever Alex’s hidden agendas and identities, their relationship has been truthful and real on some level. Danny’s credibility and even his life are often at stake, but the way that Scottie, a well-connected bureaucrat, helps him dig up some of the truth is generally depicted believably.

It’s no wonder that Whishaw (“Spectre”) is appearing constantly in film and television; he’s clearly one of the finest actors of his generation. He plays Danny’s doggedness and confusion with unwavering conviction, and it’s hard not to admire the character’s devotion to the facts, whatever the cost. The security services, the media and even Scottie are continually surprised by Danny’s persistence, but Whishaw makes Danny’s disdain for his personal safety somehow seem winning, and there’s an innocence about the character that offsets some of the darkness and turbulence of his past. Danny may not have much in the way of money, power or education, but, as the story progresses, his integrity exceeds that of almost everyone involved in Alex’s life.

Occasionally, the show veers into overly enigmatic preciousness; one scene set in a bathhouse is shot from an odd and distracting array of angles. But when Broadbent, Rampling and Whishaw are given confrontational conversations to dig into, “London Spy” is nothing short of mesmerizing. Broadbent is wonderfully subtle throughout, so when he goes big in a scene in which he recounts the security services’ persecution of gay employees, it’s impossible to take your eyes off him. Smith does a generally fine job of exploring the ways in which spy agencies have used the sexual identities of their agents to cow, manipulate and harass them in the past, and “London Spy” implies not much has changed since the discriminatory “mole hunts” of the past.

The narrative goes a bit Gothic as it enters the home stretch; it’s a bit on the nose for characters in a twisty spy story to wander through a hedge maze on a country estate. That said, this cast — which included Mark Gatiss as a memorably decadent music producer — would be gripping even if its members were reading the phone book. Perhaps the greatest compliment that can be paid to the show is that images and moments from this distinctive story are likely to linger in the memory for days. Danny can’t give up the search for what he knows to be real, and “London Spy” pays tribute to that resilience by offering indelible moments of discovery, romance and fury.

TV Review: ‘London Spy’

(Series; BBC America, Thurs. Jan. 21, 10 p.m.)

  • Production: <p class="p1"><span class="s1">Filmed in London and Kent by Working Title Television, BBC America, BBC Two, NBC Universal and BBC Worldwide. </span></p>
  • Crew: <p class="p1"><span class="s1">Executive producers, Tom Rob Smith, Juliette Howell, Tim Bevan, Eric Fellner, Polly Hill, Hilary Salmon, Liza Chasin; producer, Guy Heeley; director, Jakob Verbruggen; writer, Smith; camera, Gerry Vasbenter; production designer, Lisa Hall; editor, Victoria Boydell; music, David Holmes; costume designer, Suzanne Cave; casting, Nina Gold, Robert Sterne. <strong>60 MIN</strong></span></p>
  • Cast: <p class="p1"><span class="s1">Ben Whishaw, Jim Broadbent, Charlotte Rampling, Adrian Lester, Mark Gatiss, Edward Holcroft </span></p>
  • Music By: