Detectives Danson (Dwayne Johnson) and Highsmith (Samuel L. Jackson) are pursuing a group of criminals in a Cadillac Escalade. After a brief firefight that results in the hood of Highsmith's Chevy Chevelle getting blown into the windshield, the two inadvertently crash into the side of a double decker bus. Danson drives it after the criminals and meticulously slingshots the trapped car out the other side of the bus (with Highsmith firing the whole time) and crashing into the Trump Tower, inexplicably surviving. The criminals manage to get away, until police backup quickly arrives and arrests them.
Detective Allen Gamble (Will Ferrell), is a forensic accountant who is more interested in paperwork than hitting the streets, but idolizes Danson and Highsmith. Detective Terry Hoitz (Mark Wahlberg) has been stuck with Allen as his partner for the past seven years ever since he shot Derek Jeter during the World Series. Allen and Hoitz receive no respect from the other officers, who trick Allen into firing his gun in the office (a "desk pop"), leaving him with a wooden practice gun as punishment. During a pursuit of a group of professional bank robbers, Danson and Highsmith die when they jump off a 20-story building into the sidewalk, inexplicably agreeing to aim for bushes that aren't there.
When an opportunity arises for Terry and Allen (the "other guys") to step up, things do not quite go as planned. Allen begins to investigate a scaffolding permit violation and winds up uncovering a much bigger plot by multi-billionaire David Ershon to cover his company's losses. As things get worse, Allen and Terry are forced to split up. Allen still tries to solve the crime on his own, even though Terry thinks it is a dead end. He finally gets credible evidence and earns his gun back. Allen finally convinces Terry to rejoin him. They stop the criminals who are trying to scam the money that initially Allen believes the $32 billion Ershon seeks will come from the New York Lottery Office, but he discovers it will really come from the New York Police retirement fund. Both officers end up getting shot (Terry taking one in the knee and Allen taking one in the shoulder.) The police finally come, rescue the two and arrest Ershon and Wesley. The two believe that the true heroes are the ones who make the world a better place, not the ones who appear in the newspaper or on TV. Ershon's arrest leads to a stock market crash and a subsequent federal bailout. The film ends with a peacock flying by the screen in reference to Terry's remarks that he "is a peacock you gotta let me fly" as Terry and Allen drive off.