Going back to the well on eerie orphanages isn’t nearly as annoying as Will Ferrell revisiting flagrantly foul sports shtick, but Guillermo del Toro has sort of done The Orphanage before.

His brilliant Pan’s Labyrinth earned the Mexican filmmaker well-deserved credentials, and The Orphanage is his baby by adoption. del Toro produces and presents the film, an atmospheric, layered horror tale written by Sergio G. Sanchez and directed by J.A. Bayona.

It lacks the historical detail or enthralling magic of either Labyrinth or The Devil’s Backbone, del Toro’s own 2001 film about a haunted Spanish orphanage in 1939. And it’s reliant on far more flashy boo scares than its somber story really can support.

Yet Bayona’s spook-house story ultimately compels with its intriguing subtext, a fierce lead performance by Belen Rueda and an ending that achieves everything the overrated The Others sought, and failed, to do. (That’s no plot spoiler, mind you, just a matter of mood and emotion.)

Carlos (Fernando Cayo) and Laura (Rueda) are a husband and wife rehabbing an old orphanage at which Laura lived as a child. Their curly haired young son Simon (Roger Princep) knows neither that he’s adopted nor that he’s HIV positive. It’s a heartbreak beyond Simon’s understanding or control when, after reading Peter Pan, he says he never wants to grow up.

The plan is to adopt five more children, in hopes they’ll be friends to solitary Simon. He already has two imaginary pals and finds a third, named Tomas, during a trip to a seaside cave. Childhood delight turns to despair when Tomas “leads” Simon to discover his secrets, confront his parents and vanish at a party. When a wheezing, growling kid in a burlap mask shows up and Laura is sure she sees Simon in the cave, there’s clearly something supernatural afoot.

As months pass, Laura learns of an orphan who died at the orphanage after her departure. Benigna (Montserrat Carulla), a pesky, googly-eyed social worker is poking around. Clanging rings out in the middle of the night. And even when the beds are empty, it seems as if someone’s in them.

Bayona likes trailing his camera down long, dark hallways (it’s a ghost’s POV … we get it), unleashing loud jolts, lingering on “there … not there!” scenes of pale little children and shifting his film stock to green, grainy surveillance footage (for a medium’s visit to the orphanage). To his credit, Bayona orchestrates one guaranteed seat eruption. (When it happens? Not a chance.)

More understated, and impressive, is the way Laura and Carlos must wrestle with their parental guilt and child-raising consciousness — whether sheltering Simon from circumstances of his birth might have led to all this uncertainty, fear and sadness.

The Orphanage‘s mental anguish and unease feeds a last act that finds Laura facing down the orphanage’s haunted history to find her son. Rueda carefully treads the line of her sympathy and sanity; is Laura mad or just trying to follow all the rules and clues that she’s found? Thanks to her, in its final minutes, this so-so spook-house story becomes solid and moving, and its final beat both spells it out for the confused and gently finds the right bittersweet touch of familial compassion.