WARNING!! MINOR SPOILERS TO FOLLOW. RELAX, I’M WITHHOLDING 90 PERCENT OF THE SURPRISES, I PROMISE:

About a half-hour into “Batman v Superman: Dawn of Justice,” I was starting to feel this could be one of the best superhero movies of the last 20 years.

Alas, we go from spectacular to solid, from great to good.

That said, Zack Snyder’s hotly anticipated showdown of two great DC Comics icons is hardly a disappointment — and please see it on the biggest IMAX screen within 50 miles of your home if you can.

“Dawn of Justice” is a dark-palette feast for the eyes, with some memorable set pieces, just the right amount of dark humor, strong performances and so many inside references and hints of characters and films to come there could be an entire day of Comic-Con panels just about the spoilers and the teasers and the “WHOA!” moments.

In an opening flashback to 1982, young master Wayne and his parents are exiting a movie theater when tragedy strikes. (We must be up to a dozen movies and television shows that have depicted the brutal murders of Bruce’s beloved mother and father.) The scene is filled with some haunting and chilling images, e.g., Bruce’s mother’s pearls getting snagged over the barrel of a gun in her last breathing moments.

Cut to present day and a title card reading:

“MANKIND IS INTRODUCED TO THE SUPERMAN”

I love that. We’re plunged into a breathtaking sequence in which we see the epic final battle between Superman (Henry Cavill) and Gen. Zod in which half of Metropolis was leveled — but it’s from the viewpoint of none other than Bruce Wayne (Ben Affleck), who apparently now has headquarters in Metropolis.

Snyder films the scene with gritty realism, including some shots that seem deliberately to pay homage to 9/11. Even though WE know Superman was on the side of good and Zod was evil on that fateful day, Bruce Wayne and nearly all of the citizens of Metropolis had no idea what was transpiring.

Now here’s where “Dawn of Justice” gets a little murky. It seems as if Metropolis (home of Clark Kent/Superman, Lois Lane, the Daily Planet, etc.) is practically a twin city with Gotham (home of Bruce Wayne/Batman, Alfred the butler et al). In a scene where Bruce Wayne shows up at a party hosted by young Lex Luthor (Jesse Eisenberg), Lex says, “You should hop over the harbor more often.”

Some 18 months later, Superman is well established as a good guy. There’s even a Heroes Park (built by Lexcorp!), with a giant statue of Superman. When the Man of Steel performs amazing rescue missions around the globe, some kneel and bow their heads, or reach out to try to touch him, treating him as a deity from the heavens.

Others are expressing concern about Superman’s limitless powers. Look at all the collateral damage that occurs whenever Superman swoops in and saves the day. (Hooray. For years I’ve been wondering why the Avengers and the X-Men and Superman and Batman, not to mention the mortal action heroes of the “Die Hard” and “Fast and Furious” and James Bond movies, almost never even pause to consider how many innocent lives are lost, how many cities are destroyed, as they duke it out with the bad guys.)

Holly Hunter delivers strong, sharp-edged work as a Kentucky senator who wants to hold hearings to see if Superman should be held accountable for deaths that have occurred when he’s swooping in to save the day.

Meanwhile, Bruce Wayne/Batman is angry, frustrated and exhausted after 20 years of battling criminals in Gotham (and presumably Metropolis). At this point Batman is in full vigilante mode, literally branding criminals with the Batman logo before serving them up to authorities.

Even Bruce’s loyal butler Alfred (the magnificent Jeremy Irons) is in unshaven, deeply cynical mode, spouting out Shakespearean lines about the nature of justice and muttering about his boss never settling down and starting a family.

Snyder and screenwriters Chris Terrio and David S. Goyer raise some interesting questions about humankind’s love/fear/worship/hate relationship with all-powerful beings, whether they are God or Allah or Buddha or Superman. At times the metaphors get a bit heavy-handed, as when protesters in Washington, D.C., hoist signs that read, “SUPERMAN = ILLEGAL ALIEN.” We get it, we get it.

Here’s what rocks. We all know Batman, even with all his fighting skills and his cool toys and his cunning, would be no match one-on-one against Superman. “Dawn of Justice” figures out a way to level the playing field and then some. And though Gal Gadot’s Diana Prince/Wonder Woman sometimes seems crowbarred into the plot, there are a couple of moments guaranteed to get the hardcore geek base, well, geeked.

All the Internet resistance to Affleck being cast as Batman seems silly when you see him sharing the screen with Cavill, as Affleck is easily the superior actor. (Cavill is solid, but there’s not all that much difference in his facial expressions registering anger, fear, pain or love. He winces quite a bit.) There’s not a moment when we don’t believe Affleck as Bruce Wayne or as Batman.

Amy Adams’ Lois Lane is a modern, self-sufficient, strong woman — but she still needs rescuing by Superman every other week. Jesse Eisenberg’s twitchy, self-conscious mannerisms can be irritating in some performances, but he’s a creepy delight here as Lex Luthor. First-rate actors such as Diane Lane and Laurence Fishburne sparkle in small roles.

With a running time of 2 hours, 33 minutes, “Dawn of Justice,” like most superhero movies, just keeps on coming and coming — especially in the climactic battle sequence, which isn’t all that different from the climactic battle sequences in a dozen other superhero movies. And the final surprise will come as a surprise to just about no one.

When it sings, “Dawn of Justice” is a wonder. When it drags, it still looks good and offers hints of a better scene just around the corner.

★★★

Warner Bros. presents a film directed by Zack Snyder and written by Chris Terrio and David S. Goyer, based on characters from DC Comics. Running time: 153 minutes. Rated PG-13 (for intense sequences of violence and action throughout, and some sensuality. Opens Thursday at local theaters.