Bachelor parties and porn shoots in the company of 6 million bodies.

In the 1780s, Parisian officials started moving corpses from cemeteries to the catacombs beneath the city. What they didn’t know is that — hundreds of years later — that subterranean dump for rotting bodies would become a hipster haven.

See — back in the 18th century — Paris had a corpse problem. Cemeteries were overcrowded. The smell rising from them was so foul that perfume sellers nearby couldn’t sell anything. In 1780, spring rains caused the wall around a cemetery to collapse, spilling the dead out into the city streets.

In 1786, authorities began moving the bodies — some of them 1,200 years old — to the limestone quarries beneath Paris.

The quarries were where the Romans got the stone they used to build the city (which they called Lutetia). They’re also where France got the limestone to build the Notre Dame.

When the French Revolution exploded in 1789, the dead were dumped straight into the catacombs. They included the chemist Lavoisier, the revolutionary Jean-Paul Marat and Maximilien de Robespierre, one of the leaders of the post-revolutionary Reign of Terror. When the interments ended in 1860, the bones of 6 million people lay beneath the capital.

A worker in the catacombs, circa 1870. | Nadar/Getty

Quarrying continued right into the 19th century. After that, farmers grew mushrooms there, producing hundreds of tons a year. During World War II, French partisans hid in one part of the tunnels, and German soldiers built a bunker in another.

Today, the catacombs are considered to be “the world’s largest grave,” although

It was the punk rock craze of the late 70s that transformed the catacombs into a land of art. Young Parisians embraced punk’s DIY ethic and anarchic leanings. They found entrances to the catacombs in cellars across Paris, and created a world of art and hedonism unmolested by the authorities.

Today, many entrances have been sealed up. It’s been illegal to visit the catacombs since 1955, aside from a mile of tunnels that comprise the official Musée Carnavalet. A sign over the entrance reads “Arrête, c’est ici l’empire de la mort!” (“Stop! This is the empire of death!”)

That hasn’t stopped catacomb aficionados, or “cataphiles,” from finding their own ways in. Some cataphiles map the hundreds of miles of tunnels. Others just come to create art or party.

“Under Paris there are spaces of all kinds: canals and reservoirs, crypts and bank vaults, wine cellars transformed into nightclubs and galleries,” writes National Geographic’s Neil Shea. One dust-covered fellow Shea met underground had just come back from setting up for a bachelor party.

Subterranean revelry sometimes has fatal consequences. At one party, a 45-year-old man suffered a heart attack and died in September 2016.

Partying underground in the Paris catacombs. | yeity.com

“There are those who want to find a calm and pleasant spot,” a cataphile nicknamed “Crato” tells Gizmodo. (All cataphiles go by nicknames.) “There are those who go down to meet a partner [or] to watch movies.”

The police have a detachment that tries to keep people out of the catacombs. One day in 2004, police entering one cavern heard dogs baying all around them in the dark. Investigating, they found a public address system and a stereo playing the sound of barking.

“They found 3,000 square feet of subterranean galleries, strung with lights, wired for phones, live with pirated electricity,” writes Gizmodo’s Sean Michaels. “The officers uncovered a bar, lounge, workshop, dining corner and small screening area. The cinema’s seats had been carved into the stone itself, with room for 20 people to sit in the cool and chomp on popcorn.”

When the police returned later, it was all gone. Every last cable had been pulled up. The theater was the work of an artists’ collective called UX. For five years, they’d screened films like David Lynch’s “Eraserhead” in the tunnels.

Actor Alec Guinness in the catacomb scene from ‘Father Brown,’ 1955. | Vagn Hansen/Getty

In 2013, news broke that a very specific brand of erotic photographers and filmmakers were shooting in the catacombs illegally. The Musée Carnavalet had refused to issue them permits.

“We receive at least one [filming] request every week,” a museum spokesman tells Le Parisien; “Obviously, we say no. This is a sacred place, which houses the remains of six million Parisians. We only allow serious or scientific documentaries.” So the wily porno crews took matters into their own hands.

“These sly people pass themselves off as tourists, hiding all their equipment, like cameras, in bags. Then as soon as they get downstairs, the girls strip off, the crew films without any fuss, and they leave, unseen and unnoticed,” one visitor to the catacombs tells the paper.

Other interlopers have purer intentions.

The clock at the Paris Pantheon — a mausoleum for France’s most respected dead, including Louis Pasteur, Voltaire and Victor Hugo — hadn’t worked since the 1960s. One day in 2006, its bell began tolling.

According to Gizmodo, a clock restorer named Jean-Baptiste Viot had approached an underground collective called Untergunther the year before. Untergunther is devoted to restoring areas of the catacombs. (Their long list of restorations is a multi-generation project — it won’t be completed in their lifetimes.)

Untergunther agreed to help the clockmaker. Viot and a small team used the catacombs to access the Pantheon every night, and camped in them until Viot restored the clock to its former glory.