You expect something called “The Lego Movie” to sell toys. You just don’t expect it to do so while offering up a subversive indictment of mindless consumerism.

And you’d certainly never expect it to be so goofily, out-of-left-field, guffawing-in-spite-of-yourself entertaining.

In an upset of “Miracle on Ice” proportions, the animated “The Lego Movie” is better than this weekend’s superior-pedigreed “The Monuments Men.”

Let that sink in for a moment.

And we’re back.

Like the other residents of Bricksburg, construction worker Emmet (voiced by Chris Pratt) lives his life according to his instruction manual.

At work, he tears down any buildings deemed “weird” by President Business (Will Ferrell) and replaces them with cookie-cutter structures.

His favorite song, the mindless “Everything Is Awesome,” is everyone else’s favorite song. The same goes for the asinine “Where Are My Pants?,” his favorite TV show. His favorite place to eat? “Any chain restaurant.” And he gleefully buys $37 coffees because that’s what he’s been told to do.

But Emmet’s outlook is changed forever when he’s discovered by resistance leader Wyldstyle (Elizabeth Banks) and deemed to be The Special, the one true hero who has been prophesied to stop President Business, who’s really the supervillain Lord Business in disguise, from destroying the world. On Taco Tuesday, no less.

The Special has been foretold to be the most talented, most important, most interesting, most extraordinary person in the universe. He’s basically the Lego equivalent of the Dos Equis guy. The hitch? The only thing special about Emmet is his complete and utter lack of specialness.

Written and directed by Phil Lord and Christopher Miller (“Cloudy With a Chance of Meatballs”), “The Lego Movie” is pitched somewhere in the vicinity of “Robot Chicken,” those “TV Funhouse” shorts Robert Smigel did for “Saturday Night Live” and the results of turning a dozen 12-year-olds loose in a toy warehouse after plying them with buckets of Cap’n Crunch doused in Red Bull and just a hint of PCP.

Emmet is so relentlessly, deliriously upbeat, he wishes a cheery “Good morning!” to the walls of his apartment. And his cohorts, Master Builders who never follow the instructions but can create anything they can dream up, are literal and figurative blockheads.

Unikitty (Alison Brie), part unicorn, part kitten as her name implies, is full of equal parts rainbows, sunshine and terrifying rage. The pirate Metal Beard (Nick Offerman) lost his body in battle and replaced it with spare parts, including a shark for one arm and a cannon for another. Loopy ’80s-era spaceman Benny (Charlie Day) clearly was deprived of oxygen during some of his missions. And, as the ancient seer Vitruvius, Morgan Freeman is allowed to cut loose even more than he did in “Last Vegas.”

The most fun, though, is in the way “The Lego Movie” mashes up various worlds. It’s surely the only time you’ll see Gandalf interact with Dumbledore, watch Michelangelo share a scene with his Ninja Turtle counterpart and hear an order anything like, “Abraham Lincoln, you bring your space chair right back here.”

The moments between Superman and a clingy Green Lantern are hilarious primarily because Channing Tatum and Jonah Hill, co-stars in Lord and Miller’s “21 Jump Street,” provide the voices.

And anyone who complained when Ben Affleck was hired to play Batman in the “Man of Steel” sequel should send the Oscar winner a handwritten letter of apology after seeing “The Lego Movie’s” version of the Dark Knight. In the hands, err voice, of Will Arnett, this Batman is a bigger tool than anything you’d find in his utility belt.

Things get a bit sappy at the end, but you have to expect something in a kids movie to be aimed at actual kids. And even when the action descends into Michael Bay-style mayhem, the explosions are made with tiny Lego flames.

Full disclosure: “The Lego Movie” may have been so much fun because all evidence pointed to it’s being terrible. Going into it expecting to be overcome with joy may not produce the same results.

Still, the action-comedy unleashes more inventiveness than any movie with such crassly commercial source material since the original “Pirates of the Caribbean.”

And, in doing so, it’s laid the building blocks for a welcome all-ages franchise.