StarSolidStarSolidStarHalfStarOutline(2.5 stars)

Michael Bay didn’t direct “Bad Boys for Life,” but in ways expected and unexpected his spirit lurks in the third installment of the franchise that started with his feature debut, the 1995 odd-couple-buddy-cop-comedy-thriller “Bad Boys.” That was way back before the filmmaker was even a brand — a brand now most associated with loud, crass, action-packed blockbusters epitomized by five “Transformers” movies.

Early in the new film, Bay appears in a quickie cameo during a wedding scene in which the daughter of family-man Marcus (Martin Lawrence) — one half of the film’s titular detective duo, along with his playboy partner Mike (Will Smith) — is getting married. It’s Marcus who’s giving away the bride, but it’s Bay, who briefly handles a microphone, in the uncredited role of emcee/wedding planner, who seems to be spiritually handing over the reins of the franchise to the two kids who took over directing duties from the action veteran: Adil El Arbi and Bilall Fallah, the 30-ish, Moroccan-born Belgian filmmaking duo who broke out with “Black,” a street-wise take on “Romeo and Juliet,” and who made Variety’s list of 10 directors to watch in 2018.

The young co-directors, who are billed, in the casual manner of their generation, simply as Adil and Bilall, bring a breath of fresh air and fun energy to a franchise that felt somewhat stale, even 25 years ago, when the first film was likened, not inaccurately, to a carbon copy of “Lethal Weapon.” Adil and Bilall aren’t reinventing the wheel here. “Bad Boys for Life” is very much in the spirit of the first two films — cacophonous, at times preposterous, hyperviolent, coarse, silly — but a quarter of a century on from “Bad Boys,” it both acknowledges and punctures the absurdity of two 50-ish men, slower, more thickly upholstered versions of their former selves, as action heroes.

There was always a contrast drawn between Smith’s Mike, the badder, more often shirtless of the two, and the married, more cautious and conservative Marcus, who as “Bad Boys for Life” gets underway is itching to retire, while Mike is dedicating himself to tracking down a Mexican assassin (Jacob Scipio) who is methodically executing a list of Miami justice system bigwigs: a judge, a prosecutor, a forensics expert.

The good-natured tension and ribbing between the two old “boys” is still there — and still a bit old hat — but there is a new dynamic that juices the entertainment factor. Mike is forced to work with a new, high-tech team of young operatives dubbed AMMO (for Advanced Metro Miami Operations). Led, of course, by an old flame of Mike’s (Paola Nuñez), the three-person squad (Vanessa Hudgens, Alexander Ludwig and Charles Melton) demonstrates a borderline snotty disrespect for their elders that is, in the context of a sequel like this, extremely healthy.

Where Mike’s policing style is old-school — he extracts information from a civilian informant (DJ Khaled) by whacking the guy’s knuckles with a meat tenderizer — AMMO’s methodology involves weaponized surveillance drones, cracking cellphone call logs and other, more generally bloodless tools of 21st-century law enforcement. The banter between Mike and the members of the AMMO crew lends the film a crackling humor that goes a long way toward defusing the frequent — and sometimes disturbingly dark — mayhem that characterizes this movie.

During the film’s climax, which takes our heroes to a creepy, decaying Mexican hotel decorated with the trappings of Santa Muerte (“Holy Death”), a folkloric female personification of the Grim Reaper, Marcus refers to a “darkness that swallows you whole.” It’s a reference to a key plot twist that gives “Bad Boys for Life” a subtext that is a bit heavier than what fans of the series might be used to. But the script, by Chris Bremner, Joe Carnahan and Peter Craig, always stays just this side of truly, deeply unsettling.

Mike, for his part, characterizes that same plot twist with a euphemism, saying that he has a “history” with a certain character. But at this point, he has a history with lots of characters: not just Marcus, but their now gray-haired police captain (Joe Pantoliano, who, of course, returns — how could he not?).

It is that history that Adil and Bilall both honor and gleefully flip off here. Like their cinematic forebear Bay, they told Variety that they hope one day to become a brand, specifically one known for “in-your-face, entertaining, next-level s---.” With this film in the can, a sequel hinted at in its ending, and discussions underway with producer Jerry Bruckheimer for directing “Beverly Hills Cop 4,” they’re already well on their way.

R. At area theaters. Contains strong bloody violence, crude language throughout, sexual references and brief drug use. 124 minutes.