The Madras High Court on Thursday expressed concern about religious dress codes being used to divide people on communal lines, The Hindu reported.

The court made the remarks in response to two public interest litigations that demanded that only Hindus should be permitted to enter temples and they should wear “Sanathana Dharma” marks on their foreheads. The petitioners also demanded that people visiting temples should wear appropriate clothing such as dhotis, kurta-pyjamas and saris.

In response to the petitions, Acting Chief Justice MN Bhandari asked if the country was paramount or religion. “Really shocking that somebody is for hijab and some for dhotis inside temples,” he said, according to The Hindu. “What is the message you are sending? Is this one country or divided on the basis of religion?”

The judge made the comments in the context of protests in Karnataka by Hindu students and mobs of men against women wearing hijabs at educational institutes. Videos of men in saffron scarves heckling Muslim women and hoisting saffron flags in schools have also gone viral on social media.

“What is found from the current affairs is nothing but an effort to divide the country in the name of religion,” the acting chief justice observed, according to the Hindustan Times.

One of the petitioners, Rangarajan Narasimhan, said that there was no doubt about the oneness of the country. However, he said that functions in Hindu temples should be conducted as per the “Agama Sastras” and claimed that the scriptures prohibit non-Hindus from entering temples.

Advocate General R Shunmugasundaram told the judge that foreigners and non-Hindus were permitted only till the flag post and not till the sanctum sanctorum. He added that temples have displayed notices prohibiting non-Hindus from going past a certain point.

The court has issued a notice to the Hindu Religious and Charitable Endowments department seeking its response.

The acting chief justice also told the petitioner to state which part of the Hindu rituals refer to trousers, dhotis or shirts could be imposed as a dress code. The court has given him ten days’ time to file his reply.