In the middle of “BlacKkKlansman,” Spike Lee’s new joint — his best nondocumentary feature in more than a decade and one of his greatest — Ron Stallworth and his sergeant have an argument about the future of the Ku Klux Klan. It’s the early 1970s, and Ron (John David Washington), the first African-American officer hired by the Colorado Springs Police Department, has infiltrated the local Klan chapter and chatted on the phone with David Duke (Topher Grace), the organization’s national director.

That title sounds more respectable than the traditional grand wizard, and Sergeant Trapp (Ken Garito), who supervises the department’s undercover unit, insists that the smooth-talking, telegenic Duke has his sights set on the political mainstream. Duke and his allies are developing an electoral strategy based on potent, divisive issues like immigration, affirmative action and tax reform that could eventually lead to the White House. Ron laughs. The guys he is tracking are potentially dangerous, but also patently ridiculous. “America would never elect somebody like David Duke president,” he says. The sergeant asks, “Why don’t you wake up?”

His plea is something Mr. Lee’s fans have heard before — remember the last scene in “School Daze”? — though rarely from the mouth of a white character. It has less to do with the iffy, easy-to-satirize concept of “wokeness” than with the urgent need to see what is right in front of you. And beyond its stranger-than-fiction, somewhat embellished real-life story — the actual Ron Stallworth actually did infiltrate the Klan, and wrote a book about it — “BlacKkKlansman” is a furious, funny, blunt and brilliant confrontation with the truth. It’s an alarm clock ringing in the midst of a historical nightmare, and also a symphony, the rare piece of political popular art that works in all three dimensions. (The soaring, seething, luxuriant score is by Terence Blanchard, Mr. Lee’s frequent and indispensable collaborator.)

As the movie reminds us — right at the end, when it makes a harrowing transition from re-enactment of the past to raw, present-tense video — we currently have a president whom David Duke likes very much. Rather than add his voice to the chorus trying to explain how we got here, Mr. Lee (who shares screenwriting credit with Charlie Wachtel, David Rabinowitz and Kevin Willmott) muses that we might have been here all along. Which doesn’t mean that nothing has changed, but rather that the racist attitudes and ideas Ron finds among the Klansmen (and around the police department’s station house, too) are durable and tenacious facts of our national life.

As such, they have always been part of the legacy of American movies too. The first image in “BlacKkKlansman” is a famous, stirring shot from “Gone With the Wind,” of wounded Confederate soldiers around the Atlanta railroad station under a tattered battle flag. The climax involves a screening of “The Birth of a Nation,” the 1915 D.W. Griffith epic that simultaneously spurred the rise of the Second Ku Klux Klan and of cinema as an art form.

In a sly and stunning tour de force of film-geek dialectics, Mr. Lee uses one of Griffith’s signature innovations — parallel editing (also known as crosscutting) — to unravel the deep ugliness of Griffith’s hymn to the heroes of white supremacy. As the modern Colorado Klansmen hoot and holler and eat popcorn, reveling in the exploits of their predecessors, a group of black students and activists gather in another part of town to hear the testimony of an old man (Harry Belafonte) who witnessed the lynching of his best friend in Texas around the time “The Birth of a Nation” was playing in theaters. The juxtaposition is chilling and revelatory. The righteous rhetoric of racism is conveyed with the scale and glamour of motion-picture technology, while its grisly truth is communicated by means of still photographs and simple words.

That asymmetry is the film’s organizing principle and central insight. Ron’s first undercover assignment is to attend a speech given by Kwame Ture (Corey Hawkins), formerly known as Stokely Carmichael, who popularized the phrase “black power” in the late 1960s. Duke’s language sometimes echoes Ture’s — Klansmen and black militants both refer to the police as “pigs” — but to see “BlacKkKlansman” as the story of an embattled man in the middle contending with extremists “on both sides” would be to miss the point entirely.

It is true that Ron is caught in a tricky position. At the Kwame Ture event, he strikes up a flirtation with Patrice Dumas (Laura Harrier), the president of the Black Student Union at Colorado College. As their relationship progresses (without Patrice finding out what Ron does for a living), they argue tactics and philosophy. Is it better to work inside the system, to push against it from the outside or to smash it to pieces? This is an old, unresolvable debate, a tension that has partly defined Mr. Lee’s own career.

His fearless embrace of contradiction gives “BlacKkKlansman” its velocity and heft. It is worth pausing to admire its sheer, dazzling craft, the deftness of its tonal shifts — from polemical to playful, from humorous to horrific, from blaxploitation to Classical Hollywood and back again — and the quality of its portraiture. Mr. Washington is witty and charismatic (yes, he’s Denzel’s son), and like Ron he takes the job seriously and enjoys the hell out of it. Detective work, like detective movies, can be a lot of fun. The layers of intrigue and suspense show Mr. Lee’s sometimes underappreciated genre skills. The low-key psychological insight demonstrates his (also underrated) way with actors.

Image

Laura Harrier as Patrice and Mr. Washington as Ron Stallworth in the film.CreditDavid Lee/Focus Features

While Ron reaches out to the Klan over the telephone — “whitening” his voice in the manner of countless stand-up comedians — he can’t very well show up at meetings. That job falls to Flip Zimmerman (Adam Driver), who starts hanging out with local stalwarts of “the organization.” These include a square-jawed bureaucratic type named Walter (Ryan Eggold), a clever devil named Felix (Jasper Paakkonen) and a drunken doofus named Ivanhoe (Paul Walter Hauser). With the help of another detective, Jimmy Creek (Michael Joseph Buscemi), Flip and Ron keep tabs on a terrorist conspiracy evolving amid all the posturing and slur-slinging.

Mr. Lee has often been a gleeful curatorof racial invective, and he observes the Klansmen with a fascination that stops only a few degrees short of sympathy. They are monstrous and clownish, but more than just figures of fright or mockery. Understanding what makes them tick is as much Ron’s mission as bringing them down.

And though the dramatic crux of the film is Ron’s predicament, his is hardly the only racial identity crisis under scrutiny here. Throughout his career, Mr. Lee has frequently turned his attention to the souls of white folks, to the volatile mix of pride, resentment, defensiveness and denial that motivates characters in (most notably) “Do the Right Thing,” “Summer of Sam” and “25th Hour.” When Flip criticizes Ron for treating their undercover work as a crusade — “for me it’s a job,” he says — Ron brings up Flip’s Jewish background, and the virulent anti-Semitism that accompanies the Klan’s anti-black bigotry. Flip says he never thought much about being Jewish: “I was always just another white kid.”

Later, he wonders if that amounted to a kind of passing. “BlacKkKlansman” is about the boundaries of group identity, and how a person can or can’t cross them. On the phone with David Duke, Ron passes for white, but in Patrice’s eyes his presence on the police force is its own kind of trespass. Some of his fellow officers see it the same way, though from the opposite side. But white people, who have more of everything, also have more opportunities for disguise.

“Just another white kid” is an all-purpose alibi, and public discourse abounds in code words and dog-whistles that allow bigots to pass as concerned citizens without a racist bone in their bodies. And vice versa. Committed anti-racists can sit quietly or laugh politely when hateful things are said. Epithets uttered in irony can be repeated in earnest. The most shocking thing about Flip’s imposture is how easy it seems, how natural he looks and sounds. This unnerving authenticity is partly testament to Mr. Driver’s ability to tuck one performance inside another, but it also testifies to a stark and discomfiting truth. Maybe not everyone who is white is a racist, but racism is what makes us white. Don’t sleep on this movie.