Whoever, with the intention of wounding the feelings of any person, or of insulting the religion of any person, or with the knowledge that the feelings of any person are likely to be wounded, or that the religion of any person is likely to be insulted thereby, commits any trespass in any place of worship or on any place of sepulture, or any place set apart for the performance of funeral rites or as a depository for the remains of the dead, or offers any indignity to any human corpse, or causes disturbance to any persons assembled for the performance of funeral ceremonies, shall be punished with imprisonment of either description for a term which may extend to one year, or with fine, or with both.
Section 297 punishes acts of three kinds:
i) Trespass in place of worship or upon the sepulture of the dead,
ii) Indignity to a human corpse, and
iii) Disturbance in a funeral ceremony.
Section 297 punishes a person who trespasses on burial place or on places of sepulture. The trespass may be a civil trespass or mere encroachment or an unauthorized entry without amounting to criminal trespass. Trespass here means any violent or injurious act, committed in a place of worship with such intention or knowledge as is defined in Section 297. When some persons had sexual connection inside a mosque, they were offenders under Section 297.
The essence of Section 297 is an intention, or knowledge of likelihood, to wound feelings or insult religion and when with that intention or knowledge trespass on a place of sepulture, indignity to a corpse, or disturbance to persons assembled for funeral ceremonies, is committed it becomes an offence under Section 297. The guilty shall be punished with imprisonment which can extend to 1 year, or fine, or both.