The Marquis de Sade, who died two centuries ago (2 December 1814), lived a turbulent life. He was born into an aristocratic Provençal family, enjoying all the privileges of the ancien régime before it took against him; he kept his head through the French Revolution and died, aged 74, in a lunatic asylum.

His libertarian writings alienated two kings, a revolutionary tribunal and an emperor. He spent most of his adult life under lock and key: if they couldn’t get him for being bad, being mad would do.

In his final miserable years, Sade was an obese, despised and penniless social outcast. Yet soon after his death in 1814 his reputation began to climb. He was claimed as a hero by writers and artists; in 1839, he was hailed as “one of the glories of France, a martyr… the very high and powerful seigneur de Sade”.

He is now a seminal (an unfortunate though apt adjective) cultural figure. In France this year, celebrations are being held in his honour: the Musée D’Orsay is currently hosting an exhibition tracing the influence of Sade on Goya, Géricault and Picasso. The manuscript of his most notorious work, The 120 Days of Sodom, has been bought for seven million euros; his Provençal châteaux is owned by Pierre Cardin and acolytes beat a path there every year.

Sade’s bizarre psychopathy and life story, as much as his gruelling writings, have inspired such disparate figures as Flaubert, Angela Carter, the Surrealists, Camille Paglia and Pier Paolo Pasolini. American Psycho’s Patrick Bateman is a descendant of Sade’s murderous protagonists; Edward St Aubyn’s Patrick Melrose grows up in the shadow of Sade’s chateau, with a violent, abusive father who could have walked straight from the pages of Sade’s 1791 novel Justine. And let’s not forget Moors murderer Ian Brady, whose youthful reading of Sade apparently inspired his fantasies of domination and murder.For over 150 years, the Sade family regarded their notorious ancestor as a dirty secret: the eldest son of each Comte de Sade was not even given the title of marquis. But in the last 25 years things have changed. “People are no longer scared of Sade,” says his descendant, Hugues de Sade, who produces wine under his forebear’s name. More letters and documents have been discovered in family attics and a Sade publishing industry is enthusiastically endorsed by his heirs.

Sade has also made appearances on stage and in film. In Peter Weiss’s play, Marat/Sade, memorably filmed by Peter Brook and set in the asylum of Charenton, Sade cuts a bitterly impressive figure, filled with rage at the decay of revolutionary ideals. In 2000 Sade was portrayed with great charm by Geoffrey Rush in the film Quills.

Sade’s life story is as outlandish as anything by Victor Hugo or Alexandre Dumas. It includes two daring prison breaks and a close shave with the guillotine. There was even a Valjean-Javert dynamic in his relationship with his nemesis, the police inspector Marais, who hounded him with obsessive diligence.

So how did an aristocrat born in the opulent Condé Palace in Paris in 1740 end up in a lunatic asylum? No one could have foreseen his trajectory. The Sade family were ancient, venerable and wealthy, with one ancestor, Laure de Sade, claimed as the original of Petrarch’s muse Laura. The delightful but self-willed boy embodied all his family’s hopes.

In the ancien régime, being a libertine wasn’t unusual. Madame de Pompadour, mistress of Louis XV, had remarked disgustedly of the orgies that were commonplace in aristocratic circles. Sade’s father, the Comte de Sade, and his uncle, the very unclerical Abbé, were known for their debaucheries. But from his twenties on, the handsome young marquis caused alarm with his perverse antics.

Most disturbingly, for an age of rigid class distinctions, he disliked his fellow aristocrats, preferring to go whoring with his hunky valet, sodomising and being sodomised by him in his turn, or masturbating him, watched by prostitutes. On one occasion, they scandalously switched roles, Sade addressing the servant by his own title.

Sade’s biographer, Francine du Plessix Gray, notes a pleasing paradox: “There are plenty of non-violent sadists and the marquis was one of them.” Unlike many aristocrats, he never fought a duel and didn’t seem to like hunting. Despite lending his name to the common term for psychopathic cruelty, Sade was at least as enthusiastic about being beaten as beating others. A prostitute once blanched at being handed a bloodstained metal implement – but the blood was all Sade’s.

More horrifying were the attempts to desecrate the Host in sexual acts. One prostitute was forced to listen to Sade’s frenzied arguments against the existence of God over the course of a long night. As news got out, Sade became a hate figure for the press, and was found guilty by public opinion.

He was imprisoned under the lettre de cachet system, which meant indefinite confinement with no prospect of a trial. Sade’s sexual energies were released into reams of fiction, more resembling horror than pornography. It’s hard to imagine anyone getting off on Sade’s works: his grim subject matter included paedophilia, murder and coprophilia. (He gave prostitutes pills intended to bring on flatulence, and then crouched expectantly under their buttocks.)

Sade’s distress at his confinement, combined with his sense of entitlement, sexual peculiarities, hatred of religion and an obsession with numerology, gave rise to his precisely ordered fantasies of lust, omnipotence, cruelty and revenge – fantasies that some argue prefigure Nazism.

As well as being relentless in their themes, his works were enormously long. One Hundred and Twenty Days was written in tiny letters on a paper scroll, easily hidden in his cell in the Bastille. In part a savage satire of the ruling class, it details the tortures and murders committed by four elderly libertines who, over the course of a winter, hole themselves up in a remote castle with dozens of male and female victims. First published in 1904, it is a remarkable tour through the mind of a sex maniac: shocking, terrifying – yet on occasion also stupefyingly boring.

Sade would have been one of the few prisoners to be liberated when the Bastille fell in July 1789, had he not, earlier the same month, been whisked away to detention outside Paris. Ironically, he had been deemed a security risk for shouting inflammatory speeches to the mob below his window.

Sade was unable to secure his precious manuscript of 120 Days when he was jostled out of his cell, and it vanished when the prison fell. He never saw it again. Discovered in the ruins and sold to the Marquis de Villeneuve-Trans, the manuscript passed to Germany, where it was found in 1929 by the agent of a wealthy collector and Sade descendent Marie-Laure de Noailles. Stolen from the family in 1982, it turned up in the hands of Swiss erotica collector Gerard Nordmann. The dispute between Sade’s and Nordmann’s heirs was recently concluded with the purchase of the manuscript for 7m euros by a company that intends to present it to the French state.

In many ways, Sade was a startlingly modern thinker. He despised the notion that women were merely vessels for procreation and celebrated their orgasmic potential. His laying bare of institutional misogyny made him a paradoxical hero for some feminists. Angela Carter wrote a book on him called The Sadeian Woman.

Sade’s notions about the ungovernable violence lying at the core of civilised society, prefigured psychoanalysis (Sade himself does seem stuck at Freud’s anal phase of development). The rise of the internet troll bears out his most pessimistic thoughts about the veneer of public civility, though Sade at least was never afraid to have his name associated with his vilest imaginings.

Yet most poignant of all is his behaviour during the Terror. Seen as a hero for his imprisonment under the ancien régime, Sade was eventually freed from prison and, as Citizen Sade, became a revolutionary judge. If the popular conception of his nature had corresponded to the reality, he should have been in his element in this murderous era. Instead, more familiar with the line between reality and fantasy than some of his critics, he showed mercy and was imprisoned for being too lenient. “Is not that the pinnacle of perversion?”, the marquis observes in Marat/Sade, howling with derisive laughter.