The Indian Supreme Court decriminalized extramarital sex or adultery in a groundbreaking ruling. In this photo, Indian Muslim brides talk during a mass wedding ceremony at the ancient Sarkhej Roza mosque and tomb complex in Ahmedabad on March 21, 2015. Getty Images/ Sam Panthaky

The Indian Supreme Court decriminalized extramarital sex or adultery in a groundbreaking ruling Thursday.

The archaic 158-year-old law that existed under section 497 of the Indian Penal Code had stated it was a criminal offence for a man to have sexual intercourse with a married woman without the prior permission of the latter’s husband. In a landmark ruling, the law was struck down by a five-judge panel of the highest court in the country. While the law mandated a punishment of monetary penalties, or up to five years in prison, or both, for the male perpetrator, the woman in the scenario went scot-free because she was considered the victim.

On the other hand, there existed no law in the constitution which allowed a woman to prosecute her husband or women he engaged in sexual relationships with outside of their marriage, and without her consent.

“Any provision of law affecting individual dignity and equality of women invites wrath of constitution. It’s time to say that husband is not the master of wife. Legal sovereignty of one sex over other sex is wrong,” Chief Justice Dipak Misra said in a statement that he had co-written, Live Law reported.

Mishra further added while adultery “cannot be a criminal offence” it could still be used as a grounds for civil lawsuits such as divorce.

People’s attention was drawn to the colonial-era law after Joseph Shine, a 41-year-old Indian businessman living in Italy, filed a petition in August to get rid of the law, arguing it discriminated against men and women.

"Married women are not a special case for the purpose of prosecution for adultery. They are not in any way situated differently than men," his petition said.

Shine’s 45-page petition cited various references on gender equality and women’s rights through quotes from eminent personalities such as poet Ralph Waldo Emerson, women rights activist Mary Wollstonecraft and former United Nations Secretary General Kofi Annan, adding the law upheld the “erroneous presumption that women are the property of men."

Kaleeswaram Raj, a lawyer for the petitioner, said the law was often “misused” by husbands to gain an unfair advantage in divorce cases.

"Men would often file criminal complaints against suspected or imagined men who they would allege were having affairs with their wives. These charges could never be proved, but ended up smearing the reputations of their estranged or divorced partners," he told the BBC.

While ruling against the law, the Supreme Court said it aimed to control “sexuality of woman (and) hits the autonomy and dignity of woman,” which was arbitrary and unconstitutional. “Ancient notion of man being the perpetrator and woman being victim of adultery no longer holds good,” Justice Rohinton Fali Nariman observed.

The Indian government was in favor of keeping the law intact as, they claimed, it served to protect the sanctity of marriage and worked for “public good.” Prime Minister Narendra Modi’s administration even offered to make it more gender neutral by allowing for the prosecution of a woman who has sex with a married man. However, the Supreme Court refused the condition, choosing to eradicate the law altogether.

“Protecting marriage is the responsibility of the couple involved. If one of them fails, there is a civil remedy (divorce law) available to the other. Where is the question of ‘public good’ in a broken marriage?” Misra had asked during the hearings in August, Quartz reported.

The landmark ruling is the second major change introduced in the Indian constitution this month, after the Supreme Court overturned a 157-year-old law, which criminalized gay sex in India.