Los Angeles is best known for being the place that most movies are made. But it’s also infamous for its traffic jams and its electrical system brownouts and, according to the statistics printed across the screen in the opening moments of “Den of Thieves,” for being the bank robbery capitol of the world.

Yes, it’s another heist movie, a popular genre (“The Brink’s Job,” “Ocean’s 11,” “Dog Day Afternoon”) that in 2017 was a semi-regular occurrence at cinemas, with a couple of great examples — “Baby Driver” and “Logan Lucky” — gracing the screens.

This one opens with a scene that approaches parody: At 5:14 a.m., somewhere in Los Angeles, an armored car pulls up to a donut shop. But it immediately stops being a funny idea when it’s overwhelmed by a well-prepared team of masked robbers armed with automatic weapons. Things go wrong, and amid approaching police sirens, massive volleys of gunfire, and a quickly building body count, the bad guys get away, with an empty armored car.

Soon the parking lot is littered with cops, fronted by Nick Flanagan (Gerard Butler), who heads up the Major Crimes Division of the L.A. Sheriff’s Department. He’s a walking, talking caricature of a cop — coffee cup in one hand, donut in the other, cigarette in his mouth, always on the lookout for a swig of Pepto-Bismol. He initially comes across as loose and relaxed, a sort of funny wiseguy. But it’s not long before he reveals just how tough he is, and that he and his short fuse are not to be messed with.

There’s some confusion as to the motive for stealing an empty armored car, and so Nick and his crack team begin working the case, starting with a lead at a local watering hole, a shady joint called Ziggy’s Hofbrau, where they grab Donnie the bartender (O’Shea Jackson Jr.), take him away, rough him up, and interrogate him, because they believe he has some connection to the crime.

“But I was only the driver,” he finally moans, then spills more about his cohorts than was expected. First-time director Christian Gudegast impresses here with a nicely structured set of flashbacks that introduces the bad guys, run by former elite soldier Merrimen (Pablo Schreiber), and tells how Donnie became part of the gang.

It’s too bad that Gudegast and his fellow scripter Paul Scheuring also pack the film with side stories on Nick’s home life (bad marriage, yearning love for his kids), as it’s not very interesting and it mars the flow of the film. But fortunately, the main story keeps returning to the center of the action, and continues to evolve.

Regularly cutting back and forth between the criminals and their future plans, and the cops trying to figure out who the criminals are and, once they do, how to catch them in action, it’s soon seen that both sides are made up of very smart, if dissimilar men.

Merrimen’s goal is to hit the Federal Reserve Bank in Los Angeles, a building that’s so tightly secured, it’s never been robbed before, a place that regularly shreds large batches of “unfit bills,” those 10s, 20, 50s, and 100s that are no longer in good enough shape to be in circulation. As all of this plays out, it’s easy to see that Merrimen keeps a cool head, while Nick is a boiling cauldron of inner turmoil.

In short order, a small but complex bank robbery — accompanied by sweaty closeups, fast cutting, and droning music — sets the actual plot in motion, as it all evolves into an intricate heist and an example of intricate storytelling. Though most of it moves along at a tension-filled but somewhat leisurely pace, it leads to a grueling, explosive finish that neatly ties into the atmosphere of the film’s opening salvo of violence. Though the film is populated by very sharp, smart people, one of the characters is definitely smarter and sharper than the rest. The script effectively makes you wait till the final minutes to figure out who.

— Ed Symkus writes about movies for More Content Now. He can be reached at esymkus@rcn.com.

“Den of Thieves”

Written by Christian Gudegast and Paul Scheuring; directed by Christian Gudegast

With Gerard Butler, Pablo Schreiber, O’Shea Jackson Jr., Evan Jones, Curtis “50 Cent” Jackson

Rated R