In December 2013, India’s LGBT community suffered a severe setback as the country’s Supreme Court ruled homosexuality to be a criminal offence. More recently, in August 2015, the Indian government imposed a ban, lifted conditionally a few days later, on more than 800 websites deemed pornographic, in an ostensible bid to curb child pornography and sexual violence.

But India was not always like this. Sexual norms were far more liberal before the 13th Century.

India has been a particularly conservative country for the last few hundred years, influenced by the puritanism of several groups, including Islamic dynasties, British overlords and the country’s own Brahmin priestly caste. But India was not always like this. Sexual norms were far more liberal before the 13th Century, giving equal importance to the secular and the spiritual. Sex was taught as a subject in formal education, and Kamasutra, the world’s first sex treatise, was written in ancient India between the 4th Century BCE and the 2nd Century.

In fact, if you look closely, reminders of these more liberal times can be seen across the country. They’re literally carved in stone in the form of erotic motifs on the lower walls of the 13th Century Sun Temple at Konark in the east Indian state of Orissa. Nudity is prominent in the paintings and sculptures of heavenly maidens at Maharashtra’s Buddhist rock-cut monastic caves, Ajanta (2nd Century BCE) and Ellora (5th to 10th Centuries).

India's most graphic example of erotic temple art

However, the best-preserved and most graphic example of erotic temple art can be found in the small town of Khajuraho in the central Indian state of Madhya Pradesh. Its elegantly carved Hindu temples were declared a Unesco World Heritage site in 1986. Built by the Chandela dynasty between 950 and 1050, only 22 of the 85 original temples remain.

When I entered the 6sqkm site late one winter afternoon, the sandstone glowed a burnished gold. Local women carried fresh flowers and incense sticks for their prayers, while visitors perambulated the outer corridors, gawking at the profuse and intricate sculptures that covered every inch of the walls. There were images of gods and goddesses, warriors and musicians, animals and birds. It could have been a scene from any temple in India.

Many of these carvings were of an intensely erotic nature, featuring men, women and animals.

But on closer inspection, many of these carvings were of an intensely erotic nature, featuring men, women and animals. There were depictions of threesomes, orgies and bestiality. Although I knew what to expect, I was still taken aback by shapely maidens and virile men contorting their bodies in impossible sexual positions, right next to sculptures of divine beings smiling blissfully at the devout. Although a few stones were chipped and several limbs broken, the carvings were incredibly pristine, considering that the temples are more than 1,000 years old.

There are various theories about the existence of such graphic erotic motifs. One of the more exotic ones propounds that since Chandela kings were followers of Tantric principles, which dictate the balance between the male and female forces, they promoted their faith in the temples they created.

Some believe the depiction of sexual activities was considered a good omen.

Other theories have to do with the role of temples themselves in those times: they were considered places of learning as well as worship – especially of the finer arts, including the art of lovemaking. In addition, some believe that the depiction of sexual activities in temples was considered a good omen because it represented new beginnings and new life.

That apart, Hinduism has traditionally considered sex an essential part of life, which could be why the carvings are casually interspersed between others that portray activities as varied as prayer and war. The fact that they are set in plain view and not tucked away in an obscure corner seems to suggest that their creators meant for them to be seen by all.

Isolation helped these graphic motifs survive

Bizarrely, there’s no reason why these ornate temples were built at Khajuraho, since there’s no clear record of whether there was even a kingdom in this location. The survival of these graphic motifs can likely be attributed to their isolation for hundreds of years in the region’s once-thick forest, only rediscovered by Englishman Captain TS Burt in 1838. In fact, Burt himself had to be persuaded by his Indian attendants to make the journey; he didn’t believe anything of interest would be found at the remote spot. These charmed temples have also managed to evade the wrath of India’s moral police, who in recent years banned or destroyed a range of cultural artefacts, ranging from Salman Rushdie’s books to MF Hussain’s paintings.

But what I found even more interesting than the explicit carvings and the history behind them was the fact that entire families were quietly engrossed in the guide’s speech as he analysed the spicier carvings high on the walls of the magnificent Kandariya Mahadeva temple. No eyebrows were raised, no embarrassed looks were exchanged, no giggles escaped young lips. Perhaps the art is unobjectionable when crouched within a religious context – but I came away believing that Khajuraho holds within its walls a larger lesson on tolerance for India.