The French government has stepped in to declare Marquis de Sade’s manuscript, 120 Days of Sodom, a national treasure as it was about to be sold at auction in Paris.

Officials ordered that the 18th-century erotic masterpiece be withdrawn from the sale, along with André Breton’s Surrealist Manifestos, banning their export from France, the Aguttes auction house said.

They were part of a vast sale of historic documents owned by French investment firm Aristophil, which was shut down in a scandal two years ago, taking $1bn (£746m) of its investors’ money with it.

120 Days of Sodom was expected to go for up to €6m (£5.3m) on Wednesday, while Breton’s highly influential manifestos on modern art were estimated at around €4m.

Sade wrote the controversial work about four rich libertines in search of the ultimate form of sexual gratification on a roll made from bits of parchment he had smuggled into his cell in the Bastille.

When the Paris prison was stormed at the beginning of the French revolution on 14 July 1789, the famously philandering aristocrat was freed, but he was swept out by the mob without his manuscript.

Sade believed it had been lost to the looters and wept “tears of blood” over it, but the unfinished manuscript turned up decades later.

Even so, the book remained unpublished for more than a century and was banned in Britain until the 1950s.

Auctioneer Claude Aguttes, who is organising the sale, said the French ministry of culture had promised to buy the Sade and Breton works “at international market rates”.

French courts seized 130,000 historic documents which Aristophil had bought for its investors in 2015 after police said the company was a huge “pyramid scheme” in which its founder Gérard Lhéritier ran a Ponzi operation similar to that of Wall Street fraudster Bernard Madoff.

Aristophil had claimed to have collected the greatest private collection of French literary and historical documents in the world.

Lhéritier is still being investigated by judges and his lawyer Francis Triboulet has said that comparisons with Madoff and the schemes of Italian-born fraudster Charles Ponzi were misleading.

“Madoff and Ponzi sold thin air, but Aristophil sold authentic manuscripts,” he said. “Everybody is talking about the Aristophil ‘scam’ but at the same time they say it’s the most prestigious collection in the world.”

Lhéritier, 69, bought the scroll on which 120 Days of Sodom was written for €6.1m in 2014 and sold it on to Aristophil for €12.5m, insisting that its true worth at auction would now be around €17.5m.