Spike Lee opens BlacKkKlansman with the classic shot from Gone with the Wind of Scarlett O’Hara walking among hundreds of wounded and dead soldiers in Atlanta, the camera pulling back to reveal the Confederate flag in tatters. Then he segues into snippets from D.W. Griffith’s The Birth of a Nation. Later we see images of white nationalists marching in Charlottesville in 2017, the clash of protesters that left Heather Heyer dead and President Donald Trump’s comments about “very fine people on both sides.”

What do these have to do with a 1970s detective story?

Nothing. And everything.

Lee is making statements about race, racism and social justice. His point: Not much has changed in America. Not since the 1860s. Not since 1915, when The Birth of a Nation helped revitalize the Ku Klux Klan.

He also inserts several not-so-veiled (OK, super-obvious) references to “Making America Great,” “America First” and hate in the era of Trump.

But if BlacKkKlansman were only a politically charged message movie, it might not have much appeal at the multiplex. On the contrary, in addition to the hot social issues, Lee has created a terrifically compelling film filled with wonderful performances.

Best of all, it’s based on a true story. Or, as the introductory words on screen tell us: “Dis Joint is Based on Some Fo’ Real, Fo’ Real S***.”

In 1974, when Ron Stallworth joined the police force in Colorado Springs, Colo., he was its first and only black officer. His captain called him the “Jackie Robinson” of the department.

Four years later, when he was working in intelligence, he happened upon a newspaper ad for the KKK. He called the number, hurled some racist and anti-Semitic epithets and said he wanted to join. Stallworth, who said he could “speak the king’s English or jive,” passed as white on the phone. Thus began an undercover operation and a bizarre odyssey.

Stallworth’s real-life KKK investigation started in 1978, but Lee has condensed the events and set them about five years earlier, when movies like Superfly and Cleopatra Jones were all the rage, and folks were grooving to R&B gems like Too Late to Turn Back Now by Cornelius Brothers & Sister Rose.

John David Washington (son of Denzel) delivers an impressive performance as Stallworth, a man who has to figure out a way to co-exist with his white colleagues without selling his soul. When it’s time for the “white racist” Stallworth to meet the KKK members in person, undercover narcotics cop Flip Zimmerman (Adam Driver) steps in.

The faux Stallworth needs to prove his white supremacist bona fides before being allowed to join “The Invisible Empire” or “The Organization,” as the members prefer to call the Klan. The fee is only a few dollars, he is told, though “robes and hoods are extra.”

Soon Zimmerman, who is Jewish, is rubbing shoulders with an onerous crew led by Walter (Ryan Eggold), wild-eyed Jew-hater Felix (Jasper Paakkonen) and drunken doofus Ivanhoe (Paul Walter Hauser). They carry guns, practice by shooting at targets modeled after black men on the run and enjoy burning crosses — “our bread and butter.”

To add a level of absurdity, the KKK’s Grand Wizard David Duke (a suitably unctuous Topher Grace), travels from Louisiana to Colorado to rally the troops, and the real Stallworth is assigned to guard him.

The casting is spot on. Driver seems as if he’s been a detective for years, nicely underplaying. He’s world-weary, savvy in the ways of undercover work and also confronts what his Jewishness really means to him. His wisecracking partner, Jimmy, is played deftly by the nimble Michael Buscemi.

Also dropping in are Corey Hawkins as Kwame Ture, aka Stokely Carmichael, who delivers a fiery speech about black power to a group of students, and Alec Baldwin, who plays a crazed segregationist filming a vile propaganda message.

The great Harry Belafonte appears as a civil rights activist who recounts for students the story of Jesse Washington, a black man who was lynched, burned and mutilated by a mob in Texas in 1916. Lee deftly crosscuts this speech with a Klan initiation and baptism ritual.

Despite its heft, BlacKkKlansman, which is based on Stallworth’s book, is also filled with funny moments. (Should we be laughing, or crying, or both?)

Lee inherited the project from Jordan Peele, the comedian, director and Oscar-winning writer of last year’s Get Out. Peele called Lee out of the blue to see if he wanted to take it on. As Lee said recently in an interview on NBC, the whole thing sounds like a ridiculous Hollywood high-concept pitch: A black man infiltrates the KKK.

“It’s six words, that’s it,” Lee said. “At first, I thought it was a Dave Chappelle sketch.”

Clint O’Connor covers pop culture. He can be reached at 330-996-3582 or coconnor@thebeaconjournal.com. Follow him on Twitter @ClintOMovies.