In “Fist Fight,” a rowdy, vulgar, surprisingly bloody action-comedy, human punching bags Charlie Day and Ice Cube are knocked across the screen by assorted wallops, fire extinguisher blasts, head butts, random billy clubs, hostile jailbirds, office rivals in the chaotic big-city high school where they teach, unruly students, nincompoop co-workers and runaway horses.

Short of “Deadpool,” it is one of the most violent laugh fests in recent cinema. This quick, unpredictable movie, directed by Richie Keen, destroys all traces of a plausible plot in favor of controlled chaos. And it is a rousing success.

Day plays English teacher Andy Campbell, a meek, mousy milquetoast struggling through the last day of the school year amid cruel senior pranks by hundreds of bored, disrespectful kids. It’s an awful job, but he’s afraid of losing it in the latest round of staff and budget cutbacks. With his wife, young daughter and imminent new baby relying on his job, he’s willing to swallow any affront. Even being ignored and belittled nonstop by wrathful Principal Tyler (Dean Norris of “Breaking Bad” and “Big Bang Theory,” exploding in every scene like a short-circuited 50-amp fuse). Andy is competent but utterly lacking confidence.

His real nemesis enters the scene when he has a rare encounter with his combustible colleague Strickland, a tower of tough-guy arrogance played with full-throttle frenzy by Cube. Awkward, anxious and eager to please, Andy agrees to give his tech-savvy help to Strickland against a student who is sabotaging the final day of class with a concealed smartphone. Sizable collateral damage ensues, and the principal howls that one of the two teachers will be terminated as soon as he decides which one he despises more.

One rats on the other to protect his job, and they prepare for a hot MMA beatdown in the parking lot after school. It is clearly a battle for which Andy will have to reinvent himself to survive. The clever script largely concerns itself with the steep learning curve he must climb. But as the clock ticks down to the 3:30 bell, Andy’s transformation story swerves in increasingly uproarious directions.

This movie knows how to be random, hectic and stupid effectively. Jillian Bell appears as a student counselor who is self-medicating her career burnout with meth and wildly lecherous fantasies about a hunky member of the football team. Tracy Morgan is the team’s coach, blithely ignorant of every assault the student body inflicts on him. Christina Hendricks has a field day with a walk-on role as a teacher who uses a stiletto the way most use chalk.

The dialogue is ceaselessly foulmouthed in very funny ways, including a grade-school song-and-dance jubilee that pushes the film’s R rating (a strong selling point for comedies) to the edge of the envelope. As for the mariachi band that reappears at the exact moments we’ve forgotten about its last appearance, don’t ask.

This is a case of a film with a threadbare premise handling its actors and material with such assurance that it performs like a cockeyed jewel. Cube and Day have proven audience appeal, but I can’t think of a time when they have been so wonderfully silly. They are cast in familiar roles, Day’s character perpetually struggling against low self-esteem, Cube barely controlling his hothead rage. They push those conventional roles to the logical limit and beyond, skewering their own comedy résumés.

Day’s sarcastic line readings hit every bull’s-eye, and his body language as he races from crisis to crisis shows that arms, legs and hips are all you need to be sidesplitting. Cube caricatures his own swaggering brand of machismo pricelessly, leagues beyond his delightful self-parody in the “21 Jump Street” movies. They’re new men here, as the characters and, more significantly, as comedians.