On 6 September 2018, a 5-judge constitutional bench of Supreme Court of India invalidated part of Section 377 of the Indian Penal Code, hence making homosexuality legal in India. However, under the Islamic law of Fatawa 'Alamgiri during the Mughal Empire, male homosexual intercourse was punishable by flogging or stoning for a Muslim. Historical literary evidence indicates that homosexuality has been prevalent across the Indian subcontinent throughout history, and that homosexuals were not necessarily considered inferior in any way until about 18th century during British colonial rule. The ancient Indian text Kamasutra written by Vātsyāyana dedicates a complete chapter on erotic homosexual behaviour. Hindu texts have taken various positions regarding homosexual characters and themes. Homosexuality in India has been a subject of discussion from ancient times to modern times.