During the previous installment of the trilogy, which began with “Batman Begins” (2005) and continued with “The Dark Knight” (2008), Commissioner Gordon (Gary Oldman) and Batman (Christian Bale) defeated the anarchist Joker (the late Heath Ledger). They wanted to protect the public from knowing that district attorney Harvey Dent (Aaron Eckhart) had become the evil Two-Face.

In a misguided conspiracy for what he thought was a greater good, Gordon allowed Batman to be blamed for Dent’s crimes so the public would have a former public servant to rally around. For the eight years that Batman remains a recluse, the courts use Dent’s misreported death to introduce steep-to-the-point-of-cruel sentences to the criminals based on a falsehood.

Those changes result in a vigilantelike enforcement of the law and set Gotham on a collision course with the lethal terrorist Bane (Tom Hardy), who sometimes seems more like a schoolyard bully than a major villain. The masked character, who proves fairly one-note and doesn’t compare to the late Ledger’s Joker, plans to take over the city and use those who have been sentenced to extended prison stays by a law of questionable merit as a heavily armed underground army.

In “The Dark Knight Rises,” which unfolds eight years after the previous installment, the Caped Crusader is a man in need of emotional rescue in a world gone wild. The scary part is that so much of the PG-13 film reflects many of our fears about today’s world.

Through the narrative, Nolan examines themes about some of the selfish rich blindly profiting from the poor and working class, socially irresponsible government cuts (represented by a facility for at-risk children), and the lack of loyalty in today’s me-first world.

The $250 million film runs almost three hours, and Nolan maximizes the action scenes (that include a new flying weapon known as The Bat) and underscores Wayne’s doubts about the road in life he has taken. He gives each new character — including Marion Cotillard as a wealthy environmentalist seeking to make a difference in the world, Joseph Gordon-Levitt as a young dedicated policeman, and, best of all, Anne Hathaway as leather-clad Selina “Catwoman” Kyle, who can even make Batman purr — some moments to shine.

Nolan wisely underplays Hathaway’s grifter character by sprinkling her appearances throughout the story. The actress nails her scenes (no easy task for a performer in a skin-tight suit), and she’s good enough to deserve her own Catwoman project.

Michael Caine and Morgan Freeman return as Alfred the butler and the military engineer Lucius Fox, respectively. Caine and Bale face off in an emotionally charged scene with each man realizing the end of his lifelong dedication to the other is disappearing and, no matter what the outcome of the battle with Bane, may soon be lost forever.

“The Dark Knight Rises” suffers slightly from an extended story line and Hardy’s sometimes hard-to-understand Bane, who speaks through a mask, but those are minor quibbles. During the last 45 minutes, the film’s secrets and surprises float to the surface.

Some will make you smile, and others will make you sad, but it seems safe to say that most viewers — I include myself in that group — won’t know what’s coming next and will like the film even more for that reason.

Postscript: According to the production notes, “The Dark Knight Rises” marks the first time Nolan used three separate cities as backdrops for Gotham City. Scenes were filmed in Pittsburgh, Los Angeles and New York City.

Nolan also expanded his use of IMAX. Nearly half of the film was shot with the large-format cameras. “We got great results with the IMAX cameras on the last film,” he says. “I appreciate what it offers from the technical side, but I’m most interested in what it can give me as a storytelling tool.

“How can it help me pull the audience deeper into this world? IMAX provides the broadest possible canvas, creating the most immersive experience.”