"Quills," the new film by San Francisco director Philip Kaufman, stars Geoffrey Rush in a raw and witty role as the Marquis de Sade, the fallen French aristocrat shut away in an asylum for his scandalous views on sex and cruelty.

In this fictionalized account of the last years of Sade's life, the marquis writes obsessively, smuggling out his pornographic scribblings via a virginal laundress, played by Kate Winslet. When his writing tools, the quills, are taken away by authorities, Sade risks his health and sanity to continue writing -- with implements of his own devising. The film becomes an impassioned polemic on artistic freedom within a repressive political climate. In this, "Quills" has a strikingly contemporary tone.

Rush is amazing throughout this absorbing, provocative film, which is set in Gothic confines. "Quills" was written by Doug Wright; this is a screen adaptation of his play looking at Sade's time in the Charenton asylum during the Napoleonic era. Sade died at Charenton in 1814.

The grim setting is far from fertile ground for high-minded discourse or physical pleasures, but the marquis clings to his nobility with a library, courtly costume and wig, and a writing desk where he spends endless hours scrawling explicit novels and elaborate, often shocking arguments.

In his dealings with fellow inmates and prison authorities, Rush's Marquis de Sade explodes with life; he's a sharp-tongued, goading and contentious genius. He's simultaneously a child having a temper tantrum and an erudite adult nattering endlessly about what he regards as the gloriously sordid nature of people and their hypocrisy over not coming to terms with it.

Rush often makes the film soar with a sense of enlightened madness. He delivers Wright's brilliant lines with such vitality and so many shadings that he transforms Sade into a believable man, driven by the heat of inspiration but stuck in the vise of imprisonment. The role is an actor's dream, and Rush makes it all come true.

Sade didn't just like sex; he was obsessed with it. Coupled with his noted examination of human cruelty as a source of pleasure, Sade expounded on his passion for perversion with the zeal of a missionary.

The sputtering aristocrat is attended to by Madeleine, the laundress who becomes his ally. She's amused by him, and smilingly tolerates his toying with her, flirtations in which he boldly enunciates his wicked fantasies. Winslet plays the role with subtle humor, balancing innocence with a winking knowingness.

Sade is also attended by the asylum's administrator, a priest called Abbe Coulmier (Joaquin Phoenix), who is stimulated by Sade's intelligence but also driven to guide his demonic ward to a moral path. The interplay among these three characters is fascinating.

The film is gorgeously shot in spite of its grotesque setting. The asylum is filled with the mentally distressed, and "Quills" becomes an engaging study of imprisonment. The human imperative is to break bonds, however delusional. Voyeurism is everywhere; privacy is an illusion.

"Quills" is plenty naughty in language and imagery. The fainthearted may want to avoid this bold production, which revels in the lascivious if for no other reason than that it is about a passionately lascivious person. There is raw language, nudity and grotesque violence.

Yet in spite of Rush's great performance and the film's painstakingly "accurate" physical staging, "Quills" doesn't quite touch the heart. Audacious, yes. Strangely romantic, yes. Literate? Sure. But something is missing at the core. The film never quite transcends its fixation with Sade as a punished genius, even though Wright's treatment tries to turn the tale into a despairing love story, as the Abbe finds himself hopelessly drawn to Madeleine (a subplot that turns wearisome).

Michael Caine is disappointing in his role as a moralist doctor sent by Napoleon to deal with Sade. Caine's performance is a monotone -- the predictably calculating demonic type who is hypocritical every moment. Kaufman seems content to let Caine stay stone cold and not reveal the vulnerability of the tortured man behind his mask of scientific sanctimony.

Caine's performance is a reflection of some of the film's missed opportunities to engage in a more complex, layered drama, one that would have served as a better complement to Rush's brilliant work. -- Advisory: This movie contains graphic violence, explicit sex, nudity and raw language.