Facebook is headed to court over claims it censored a famous French painting of a vagina.

The social-media giant was ordered to a court in France amid claims it deleted a user’s account because he posted a 19th-century portrait of a woman’s genitals.

“L’Origine du Monde” (The Origin of the World), an 1866 oil painting by the realist painter Gustave Courbet, hangs on the walls of the Musee d’Orsay in Paris.

But teacher Frederic Durand says its prestigious status in the art world did not stop Facebook from shutting down his account because of its ban on nude images.

He accuses Facebook of deactivating his account “without warning or justification” in February 2011.

The social media network denies this.

Durand sued the company in the name of freedom of expression, but the case has only just got to court after years of legal wrangling.

Facebook made rule changes in 2015 clarifying that depictions of nudity in artwork were acceptable.

Durand wants his account restored and $24,550 in damages.

His lawyer Stephane Cottineau argued that the painting was “a major work” which is “part of France’s cultural heritage.”

The Musee d’Orsay, which has held the painting since 1995, says on its website that the work “escapes pornographic status” thanks to “Courbet’s great virtuosity and the refinement of his amber color scheme.”

Facebook fought for five years to avoid being taken to court in France over the case.

It argued that the teacher, like all Facebook users, had signed off on terms and conditions that say any legal disputes must be settled in California, where the company is based.

But a Paris appeals court ruled in February 2016 that the case should be heard in France.

On Thursday Facebook’s lawyers denied any censorship and said the account was deactivated due to “a simple contractual dispute.”

The court is set to announce its ruling on March 15.

A Facebook search today returns numerous uncensored posts featuring images of “L’Origine du Monde.”