Laced with sickening violence and variations on a mournful lullaby, Pan's Labyrinth is the kind of good-night story people tell themselves when it isn't clear they'll ever wake. Set in Generalissimo Franco's Spain, the movie is faithful to the spirit of medieval fairy tales, whose casual brutality was supposed to have inoculated listeners against the plagues and privations of life under the feudal system. But for the bookish Ofelia (a dark-eyed, plush-lipped Ivana Baquero), the fairy world isn't a training ground for real life. It's an equally plausible, and equally terrifying, alternative.

As the Spanish civil war winds down and republican insurgents take to the hills, Ofelia's mother, Carmen, (Ariadna Gil) is summoned to live at a rural outpost with her new husband, a captain in Franco's army. Carmen is in the midst of a difficult pregnancy (which will soon convince Ofelia that becoming a woman is nothing to look forward to), and when a bout of nausea forces the car to stop, Ofelia wanders off into the woods. On an ancient stone column shielded from the road by a spindly tree, the child finds an insect—a clacking, buzzing, nasty, stick-looking thing—and quickly identifies it as a fairy. We may have our doubts, but what draws us in is the way writer-director Guillermo del Toro treats the conventional distinction between a child's extended range of vision (when, in the creepy words of a magical creature, her "essence" remains "intact") and an adult's. If the fairy world is a treacherous place, full of danger for mortals, then losing the ability to see the fairies is as much a blessing as a deprivation. Or at least it would be, if the world outside were safe.

Ofelia and her mother arrive at their new home, and her stepfather (Sergi López) immediately snaps at her for some minor point of etiquette. Like any fairy-tale heroine, Ofelia has her oppressor, and almost before we get a glimpse of him, we know Capitán Vidal is it. Martín Hernández's sound design is forward and character-driven, and three distinctive motifs belong to the captain alone. First is the squeak of his new leather gloves and boots—vital accessories for the rising fascist. Second is the lubricated click of watch gears sliding into place—a hobby that aurally aligns him with the insect-like fairies. Third, there's the scrape of his straight razor, a metallic vibrato designed to make you shrink into your seat.

After confining his wife to a wheelchair, presiding over her sedation, and instructing her doctor to save the kid over the mother if given the choice, we're pretty much convinced the captain is the devil. Then he starts up with the cold-blooded murders (impassive) and the hands-on torture (impassioned). Much of his household—packed with republican sympathizers—is conspiring against him, and Ofelia first turns to the embrace of Mercedes (Y Tu Mamá También's Maribel Verdú), the housekeeper. But adult solace only goes so far. The fairies are calling.

In her alternate life, given equal weight through suspenseful crosscutting, Ofelia follows a fairy into a labyrinth, where a faun (Doug Jones) crouches in wait. She's told she's a princess, but to ensure she hasn't compromised her "essence" and thrown her lot in with the mortals, he asks her to complete three tasks. Though the makeup and animatronics can look rigid or rubbery, the creatures in the underworld are vividly imagined, and the tasks even more so. I especially love the chalk outlines that give way to doors, occasioning the only moment when fairy tricks interfere in the real world.

Pan's Labyrinth picks up scraps and notions from scattered fairy tales—fear of sexual maturity, thirst for rules and the righteous urge to subvert them, doubtful reconciliation with death—and weaves them into an original fantasy of furious power. After suffering through the many "fractured" adaptations that neuter their source material in the guise of updating it, I was beginning to worry that the primeval richness of fairy tales would have to be reserved for theater. Pan's Labyrinth chalked out an alternate route, and proved me wrong.