Cinematic enjoyment can come in the most unlikely places; a movie that you might be dreading can turn out to be an unexpected winner. That’s certainly the case with the picture that Malcolm D. Lee (Spike’s brother) has made from the internet comedy shorts written by John Ridley (who’s also fashioned the feature script with an assist from Michael McCullers). From its trailers and pre-release advertising, “Undercover Brother” promised to be little more than an African-American variant of Austin Powers, with a ’70s-style street-smart type playing a contemporary secret agent; and one could only imagine that it would be as forced, crass and unpalatable as its unaccountably successful model. (To be brutally honest, it looked like one of those awful movies based on skits from “Saturday Night Live”–something like “The Ladies Man” revisited.) But it turns out to be a smart, shrewd, even charming spoof both of the blaxsploitation flicks of thirty years ago and of the super-spy movies from the same period. Gleefully sending up virtually every imaginable stereotype on virtually all sides of the racial and gender divides, and shamelessly making a virtue out of its own visual tackiness, it’s both wonderfully dumb and extremely funny–the most exuberant and imaginative string of really silly stuff since the early efforts of Mel Brooks and the Jim Abrahams-Zucker Brothers pictures.

Eddie Griffin, who finally escapes a string of bad roles in bad movies (most recently “The New Guy”), is wonderfully adept and enormously likable as the titular dude, who sports a massive Afro, thrives on funky music and wears highly unfashionable duds, including–horror of horrors– bell-bottoms. After his Robin Hood antics foul up one of their operations, he’s recruited by a secret black organization called The B.R.O.T.H.E.R.H.O.O.D., which resolutely seeks to undermine the fiendish plans of master villain The Man, who aims to keep the races separate and preserve the socio-economic status quo. The Brotherhood, to skip all the periods, is headed by the requisite gruff head honcho (Chi McBride, Principal Harper on “Boston Public”), and includes a chubby scientific genius, Smart Brother (Gary Anthony Williams), and the suspicious, perpetually ranting Conspiracy Brother (Dave Chappelle), as well as sultry kiss-ass agent Sistah Girl (Aunjanue Ellis) and token white liberal Lance (Neil Patrick Harris–and yes, there’s a joke at the expense of affirmative action). The group smells a rat when General Boutwell (Billy Dee Williams), a Colin Powell type expected to run for president, announces that he’s going to undertake a racially insulting entrepreneurial career instead (we won’t spoil the fun here by revealing it)–just the first step in a brainwashing plan devised by The Man and his chief lieutenant Mr. Feathers (SNL’s Chris Kattan) to keep African-Americans in their place. Undercover Brother infiltrates the enemy camp to learn the details of the plot but is briefly turned away from his goal (in the direction of yuppie Uncle Thomism) by The Man’s secret weapon, the gorgeous White She Devil (Denise Richards); but happily he recovers his senses in time to help foil the brainwashing of none other than singer James Brown at The Man’s island fortress. Everything ends in a big finale, filled with one farcical fight after another, that joyously reduces all the cliches of James Bond movies to complete absurdity.

All the cast members join in the spirit of “Undercover Brother” with abandon: in addition to Griffin’s star-making turn, Chappelle pulls off his constant anti-establishment riffs with gusto, McBride retains a welcome hint of humanity behind the bluster, Ellis and Richards make the most of both their rivalry and their “sisterhood” (and show considerable physical prowess along the way), and Harris is as perfectly, and dopily, white-bread as one could wish. Even Kattan, who can come across as merely creepy, gets big laughs here. The secret is that they’re all working with exceptionally rich material. Though McCullers is credited as co-writer, it’s clearly Ridley who’s the guiding force in the teaming; “Brother” has a far different, more clever tone than the first “Austin Powers” flick (on which McCullers collaborated with Mike Myers). The script provides plenty of opportunities for great slapstick and bracingly funny dialogue–even the obligatory O.J. Simpson joke is a good one. The result might be basically a series of sketches, but they maintain an amazingly high level of invention, and Lee keeps things hopping without getting manic about it–he treats all the caricatures with a touch of affection and warmth that actually makes them oddly endearing.

Remarkably, “Brother” is also blissfully free of the rampant grossness and sexual smarminess that afflicts virtually all Hollywood farces of recent vintage; in what seems an act of comedic courage one can only hope others will imitate, it eschews the sort of blatant vulgarity that became almost de rigeur once filmmakers decided that they had to try to be the Farrelly Brothers–its few sexual references are mild, and the language surprisingly free of coarseness. What it offers instead–much the same way that “The Producers,” “Blazing Saddles” and “Airplane” did, if not on quite the same level–is a steady stream of sharp lines, hilarious sight gags and riotous situations. If that means that “Undercover Brother” is a throwback, let’s have more of them, please, and quickly. Lee’s picture easily beats “Austin Powers” at his own game.