Spike Lee’s movie “BlacKkKlansman,” which had its world premiere Monday at the Cannes International Film Festival, is “based on some fo-sure real s—,” according to an opening credit. It’s a funny, provocative profane polemic, a film with a dead-serious message under the satirical romp. It’s a crude, uneven, irreverent work that is stylistically akin to Lee’s controversial 2015 film “Chi-Raq” and “Da Sweet Blood of Jesus,” his 2014 remake of Bill Gunn’s “Ganja & Hess.” Interestingly enough, both these titles were left out of the selected list of Lee’s credits in the Cannes program booklet.

Opening with clips from “Gone with the Wind” and “Birth of a Nation,” “BlacKkKlansman” launches into faux outtakes for a propaganda film in which a chubby white supremacist is seen repeatedly flubbing his litany of Aryan-nation complaints as the voice of a prompter attempts to keep him on track. The film’s story, set in the ’70s, kicks in with Ron Stallworth (John David Washington) completing his job interview to become the first black cop in the Colorado Springs police department.

Lee gives the film a rough, low-budget look, akin to the sets and lighting of ’70s blaxpoitation. This is not a film that delivers fine acting performances or polished dialogue. It’s a send-up in which the comedy-drama is entirely in the service of political commentary, which Lee accomplishes in part with the reverse strategy of getting every conceivable bit of white-racist rant and n-word invective up on the screen and played for laughs.

Ron, the newly minted black cop, is assigned by his white chief to infiltrate a public appearance in the town by Stokely Carmichael, aka Kwame Ture, to gauge the militancy of the local black population. Lee portrays the rousing Black Power speech in its entirety, the first of many instances in which he inserts fictionalized but serious tributes to milestones in black history into the comic framework of the film. Ron also meets the event’s organizer Patrice (Laura Harrier), an Angela Davis lookalike, who becomes the love interest.

RELATED: At Cannes press conference, Spike Lee blasts Trump over white supremacists

Despite his rookie status, Ron convinces the department to let him lead an investigation into the KKK, aka The Organization. Putting on a white-man voice, he succeeds in contacting the Klan, spouting a line of racist lingo that is music to the ears of his contact. He soon receives an invitation to meet the boys in person, and therein lies the problem. A white Ron Stallworth is fabricated in the person of fellow cop Flip (Adam Driver), with black Ron calling the shots.

As black Ron continues contact by phone, eventually including hilarious conversations with David Duke (Topher Grace), and white Ron functions as the face of the operation, access to the Klan is wide open.  There’s much buffoonery to come, and a KKK plot to initiate race warfare to be foiled, with a great deal of the comedy reliant on redneck caricatures and on white Ron’s ability to one-up his quarries in virulent racism. The best lines can’t be repeated in print.

Lee alternates his racial comedy and insight with his take on history. A baptism-like Klan initiation ritual ends with the gathered devotees lustily chanting “White Power,” and a cut to a black lecture meeting reveals the audience chanting “Black Power” with equal vigor. Lee sneaks a load of contemporary political commentary into the mouths of his characters, drawing rueful laughter from the many Americans in this Cannes audience as Trumpisms decades before their time make regular appearances. “The people of the United States could never elect someone like David Duke to be president,” says black Ron. “Coming from a black man, that’s pretty naïve,” answers his white fellow cop.

“BlacKkKlansman” concludes with a series of false endings, including a wishful-thinking celebration of cop camaraderie, and a contrasting Klan rally and cross-burning, but Lee is not finished yet. The film’s coda presents footage from current events including a 2017 White Lives Matter rally at the University of Colorado, the Charlottesville tragedy with Trump’s subsequent speech, and a final dedication to Heather Heyer, who was killed when a car plowed into her and a group of other counterprotesters in Charlottesville.

“BlacKkKlansman” is scheduled to open in Chicago on Aug. 10.

Barbara Scharres is director of programming at the Gene Siskel Film Center.