Alfred Hitchcock meets Douglas Sirk in Francois Ozon’s newest, a sly, stylish blend of melodrama and suspense that’s also a cunning commentary on the seductiveness and danger inherent in storytelling itself. “In the House” is a minor masterpiece, perhaps this talented French writer-director’s best film yet.

The focal characters are Germain (Fabrice Luchini), a literature teacher in a French high school, and Claude (Ernst Umhauer), a sixteen-year old sophomore in his class. Germain is a martinet who bemoans the ever-decreasing writing abilities of his students and official pronouncements that they nonetheless be treated with kid gloves. While grading a stack of abysmal papers about “how I spent my weekend,” he comes upon Claude’s—a strange but compelling piece about the boy’s fascination with the “perfect” family of his classmate Rapha (Bastien Ughetto) and how he worms his way into their house by offering to help the struggling fellow with his math lessons. But his interest appears to be less in Rapha than in his parents, Rapha Sr. (Denis Menochet) and especially Esther (Emmanuelle Seigner). And the kid adds a postscript saying that the tale is “to be continued.”

Germain shares the paper with his wife Jeanne (Kristin Scott Thomas), whose partner in a struggling art gallery has just died and who now finds herself at the mercy of his heirs, a couple of profit-oriented twin sisters who could sell the place out from under her. She finds the story somewhat alarming, but her husband—as we learn, a frustrated writer himself—believes that Claude has real talent, and starts giving him private instruction that mostly consists of acidic critiques of further installments in his story. They detail the boy’s increasing involvement with Rapha and his parents, while the teacher even helps to strengthen Claude’s ties with them to keep the fascinating chapters coming—which, of course, he can then comment on, suggesting possible plot turns, all in the cause of nurturing an ability he himself lacks, of course.

The film juggles the various threads expertly, detailing Claude’s ever-growing attachment to his supposedly surrogate family—at least in his own writing—and Germain’s to the boy, to the extent of endangering his own job in a variety of ways, one of which involves treating young Rapha in a way that the boy considers humiliating. Claude’s obsession increases as well as he becomes intoxicated by Esther and learns about Rapha Senior’s job problems. And back in the teacher’s apartment, his wife is anxious over her own professional future while wondering whether her husband’s interest in his student is more than pedagogical.

Of course, the issue in Ozon’s canny script, played on Juan Mayorga’s play “The Boy in the Last Row,” is what’s real and what’s fiction. That’s a constant question as we watch reproductions of the incidents Claude recounts in his narrative—how much of them is reportage and how much sheer fantasy? And it’s accentuated by occasional appearances by Germain in those reproductions, commenting as he always does on their credibility and literary effectiveness. When that device first occurs it’s jarring, but at the same time absolutely right—because it forces the viewer to admit that Germain is a stand-in for us armchair voyeurs, just as James Stewart was in “Rear Window,” to which Ozon cheekily alludes in the film’s final shot. In that conclusion, “In the House” might not manage quite the trick that Germain says at one point is the proof of real art—to end in a way that’s completely unexpected yet absolutely necessary. But if the film turns out to be more clever sleight-of-hand than probing existential observation, it’s still wonderfully satisfying on that level.

As usual with Ozon, the film is visually impeccable, with production design by Arnaud de Moleron that distinguishes beautifully between the middle-class house of the Raphas and the coolly intellectual ambience of Germain’s apartment, with Jeanne’s upscale gallery and the school’s sterility also nicely captured in Jerome Almeras’ cinematography. In front of the camera, Luchini perfectly embodies the prissy, fastidious teacher, while Umhauer’s sardonic smile befits a youngster whose purpose goes deeper than anybody else suspects. With Thomas and Seigner ably representing the opposite ends of the feminine spectrum, the one a businesslike pro and the other a stay-at-home type, and Menochet and Ughetto equally effective as manipulated father and son, the cast never falters.

One might be tempted to think of “The Children’s Hour” while you’re watching “In the House.” But there’s a world of difference between a work like Lillian Hellman’s, with its earnest, almost hectoring tone, and Ozon’s exercise in exuberant artifice. The more suitable comparison is to the classic that’s alluded to in the script—the Arabian Nights, with its stories that turn and twist upon themselves and keep one wanting more. Ozon ends by reminding us that the world offers an endless variety of plots to choose from—and to savor. And as long as he keeps making films as enjoyable as this one, one can only hope he’ll tell us many more of them.