The first thing you need to know about "Shockheaded Peter," the self-proclaimed "junk opera" from London at the Kennedy Center's Eisenhower Theater through Sunday, is that it is as brilliant as it is devilish. The second thing you need to know--or maybe the first, depending on how squeamish you are--is that it is very, very devilish.

Gruesome, even. And hilarious. Have you ever been aghast--mouth open, mind scandalized--yet laughing at the same time? "Shockheaded Peter," inspired by the 19th-century tales of Heinrich Hoffmann and with music performed by the Tiger Lillies (a cabaret trio with a gritty, stripped-down sound), will do that to you. It is less literally grisly than Signature Theatre's current bloody production of "Sweeney Todd," yet it makes that musical (which is chock-full of throat-slitting and unwitting cannibalism) seem like child's play.

Child's play is much of what "Peter" is about--or rather, what happens when children play too much. With matches, say. Or when they can't stop fidgeting. Or sucking their thumbs. These are bad habits; in "Shockheaded Peter," they lead to bad ends.

"The mind is full of monsters," says Julian Bleach, who plays the nameless, cadaverous-looking master of ceremonies. He means it as a warning, but Bleach's emcee takes himself so seriously (standing at grotesque angles, rolling his R's as if he were the worst ham actor in Victorian England) that he is instantly a figure of fun. Things keep misfiring with his show--his first entrance, for instance, which is so wrong he has to start over.

There is a deliberate buffoonery to the act, directed with breathtaking skill and exquisite strangeness by Phelim McDermott and Julian Crouch, that stops "Peter" well short of being a sick voyage in forbidden psychic territory. The material skirts the edges of very bad taste--think David Lynch doing children's theater--and does indeed have a gripping nightmare sequence featuring a giant mosquito and other puppet monsters. But its clever humor and high theatricality work like a safety valve, providing just the right distancing effect. The creepy but absurd Bleach knows just when to turn the tables on the increasingly seduced audience by shooting them a look that says, "What on earth are you laughing at?"

The story (credited to the show's creators and performers: Bleach, Anthony Cairns, Graeme Gilmour, Tamzin Griffin and Jo Pocock) is about a couple who want to have a child. "The stork holds twixt its mandibles our long-awaited baby," says the hopeful father (you get an idea of the show's peculiar, ominous language--which is nothing next to its peculiar, ominous imagery). What the graceful stork puppet brings is Shockheaded Peter, who is so horrifying (actually, the puppet they use has its cute side) that they stuff him under their floorboards.

Bad move, of course. That sets up a cycle of Tiger Lillies songs with lyrics that accordionist and lead vocalist Martyn Jacques has adapted from Hoffmann's works. The band itself is a bit of a miracle: Adrian Stout plays a steady double bass, Adrian Huge rattles a drum kit so small you can wheel the entire works through an ordinary door, and Jacques sings in an eerie, boyish falsetto that can be light and sweet, operatically strong, or loaded with gravel and dementia. The band is capable of playing so slowly (during a ballad about a boy who would not eat his soup, for instance) that you can only call the tempo grave--and what else could you call it, given the way all the songs end? Other times they play like all hell is breaking loose.

Which it sometimes is onstage. The set, by Crouch and Gilmour, features a proscenium arch full of doors and windows; the arch surrounds a tiny house that is ridiculously tight inside yet accommodates all sorts of action, even bringing an ocean onto the scene (ooh, that can't be good, can it?). The effects are all resolutely low-tech--watch them create a fire out of orange and yellow petticoats and painted flames leaping out of the floor--yet witty and spectacular.

If you need a moral (and I wouldn't blame you if you did), they get to that at the very end. True to form, it's funny as hell.

Shockheaded Peter, created and performed by Julian Bleach, Anthony Cairns, Graeme Gilmour, Tamzin Griffin and Jo Pocock; directed by Phelim McDermott and Julian Crouch; set, Julian Crouch and Graeme Gilmour; lighting, Jon Linstrum; costumes, Kevin Pollard. Through Sunday at the Kennedy Center's Eisenhower Theater. Call 202-467-4600.

CAPTION: "Shockheaded Peter," a "junk opera" from London, runs through Sunday at the Kennedy Center.