For its first few minutes, the new cop comedy "The Other Guys" seems like a Jerry Bruckheimer movie mainlining a blend of crystal meth and Colt 45. It features Samuel L. Jackson and Dwayne "The Rock" Johnson as a pair of macho, swaggering supercops who kick ass and destroy property. They take down a drug gang by driving a New York tour bus -- with a vintage Chevelle muscle car jammed through it sideways -- into a glass-fronted Manhattan building, causing one of those massive fireballs from which action stars always emerge unscathed.
At the ensuing press conference on the steps of City Hall, a gushing reporter asks Danson (Johnson), "Are the rumors about you and Kim Kardashian true?" Doing his best smooth-operator Barack Obama impression, Johnson responds, "No comment -- but yes!", cracking everybody up. You might barely notice the movie's first surprise, when another reporter asks the duo whether it was worth causing all that mayhem and destruction to arrest a carload of Rastafarians holding a quarter-pound of pot. (They blow it off: "We'll let New York City decide that! Greatest city in the world, yo!") You'll definitely notice the second one, when, let's just say, Danson and his partner Highsmith (Jackson) make an unexpected exit from the film, leaving room for a new pair of NYPD alpha dogs.
Into that breach, of course, will step our awkward and ill-matched pair of heroes, the nerdy and repressed Allen Gamble (Will Ferrell), who prefers paperwork and accounting to street-cop work, and loose-cannon Terry Hoitz (Mark Wahlberg), whose aggro behavior and rampant homophobia can't conceal his massive insecurities. Gamble has never fired his gun while on duty, and spends most of the film wearing a fake revolver made of polished walnut. Hoitz, on the other hand, has indeed discharged his weapon -- on a notorious occasion when he mistakenly plugged Derek Jeter in a tunnel at Yankee Stadium, costing the Yanks the pennant. (One of his fellow cops exclaims, "He's a biracial angel! You shoulda shot A-Rod!")
Sometimes Hollywood studios stash movies in the traditional doldrums of August because they're total garbage and the executives have decided to bury them. Sometimes they do it because the movies don't fit into their preconceived marketing schemes and they don't know what the hell else to do with them. (See also: "District 9," the surprise hit and unlikely Oscar nominee released last August.) "The Other Guys" is the latest comedy from Adam McKay, the writer-director behind "Anchorman," "Talladega Nights" and "Step Brothers" (this time working with co-writer Chris Henchy) and it very much belongs in the latter category. Odder, crazier and more quietly subversive than McKay's earlier efforts -- which were already pretty funny -- this is a startling late-summer surprise that's hysterically funny when it's not falling on its face.
Ferrell is very funny here, but he's operating on familiar terrain. Gamble is another of his profoundly oblivious dudes, thoroughly out of touch with his own nature. He doesn't seem to notice that he's fatally irresistible to hot women, warning Hoitz before inviting him for dinner that his wife is a "big old lady" who can be a "total bitch." Said wife turns out to be Eva Mendes, who explains to Hoitz that they met while she was dancing at Madison Square Garden during Knicks games and finishing her medical residency at Columbia. He came into the E.R. one night with a bad case of rectal poison ivy, and Cupid did the rest! (I will tell you that Ferrell and Mendes perform a syrupy pop ballad together that's called "Pimps Don't Cry.")
Maybe this movie's biggest surprise, though, is Mark Wahlberg, who plays the damaged, vulnerable and borderline-sociopathic Hoitz with a strange delicacy, especially in a movie that's a rather broad farce, at least on its surface. I used to think of Wahlberg as a charismatic but limited star who could only play tough guys modeled after his own personality. Maybe that's still the case, but over the last decade, from "Rock Star" to "I Heart Huckabees" to "The Departed" to "We Own the Night," he appears to have gained access to ever more complicated areas of that personality. I can pretty much guarantee that Wahlberg doesn't think he's very much like Terry Hoitz, an angry and sexually frustrated little fireplug with bad hair, a series of restraining orders and an obsessive, boundary-policing interest in what he perceives as feminine or overly "gay" behavior.
Of course Hoitz and Gamble will find a way to take down the unctuous and impregnable billionaire (Steve Coogan) who has perpetrated a series of enormous financial crimes and is being protected by every level of authority, down to and including their gum-chewing, team-leader captain, a peculiar and hilarious supporting role for Michael Keaton. For some reason I cannot divine, Keaton's character is named Gene Mauch, and if you get that cultural reference, you must be nearly as old as I am. Mauch works a second job at Bed Bath & Beyond, he explains with resignation, "so my kid can go to NYU, explore his bisexuality and become a DJ."
McKay and Henchy kind of want the police-story aspect of "The Other Guys" to carry some recession-era social relevance, but it never matters enough. The movie's moments of genius are all about the absurdist byplay between the two meathead leading characters, each of whom is halfway appealing and halfway repulsive at the same time. Along the way they must contend with Gamble's psychotic ex-girlfriend Christinith (Natalie Zea) -- whose ridiculous name becomes the basis for a gag that absolutely shouldn't work but somehow does -- a side trip to the musical "Jersey Boys," and a posse of unwashed homeless men (including director McKay) devoted to holding sex orgies in Gamble's NYPD Prius. (About that decidedly unmacho vehicle, Hoitz pronounces: "I feel like we're driving around inside a giant vagina.")
Don't come back and tell me I oversold this movie: It's a mixed bag with plenty of gags that fall flat, not a comic masterpiece. But it's got tremendous zing, a sense of mischief and a big heart, more than enough to mark it as a delicious shot of caffeinated ice cream, and the summer season's funniest comedy.