India's top court has ruled adultery is no longer a crime, striking down a 158-year-old colonial-era law which it said treated women as male property.
Previously any man who had sex with a married woman, without the permission of her husband, had committed a crime.
A petitioner had challenged the law saying it was arbitrary and discriminated against men and women.
It is not clear how many men have been prosecuted under the law - there is no data available.
This is the second colonial-era law struck down by India's Supreme Court this month - it also overturned a 157-year-old law which effectively criminalised gay sex in India.
While reading out the judgement on adultery, Chief Justice Dipak Misra said that while it could be grounds for civil issues like divorce, "it cannot be a criminal offence".
Who challenged the law?
Last August, Joseph Shine, a 41-year-old Indian businessman living in Italy, petitioned the Supreme Court to strike down the law. He argued that it discriminated against men by only holding them liable for extra-marital relationships, while treating women like objects.
"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.
The law, Mr Shine said, also "indirectly discriminates against women by holding an erroneous presumption that women are the property of men".
In his 45-page petition, Mr Shine liberally quotes from American poet Ralph Waldo Emerson, women rights activist Mary Wollstonecraft and former UN Secretary General Kofi Annan on gender equality and the rights of women.
However, India's ruling BJP government had opposed the petition, insisting that adultery should remain a criminal offence.
"Diluting adultery laws will impact the sanctity of marriages. Making adultery legal will hurt marriage bonds," a government counsel told the court, adding that "Indian ethos gives paramount importance to the institution and sanctity of marriage".
What did the adultery law say?
The law dictated that the woman could not be punished as an abettor. Instead, the man was considered to be a seducer.
It also did not allow women to file a complaint against an adulterous husband.
A man accused of adultery could be sent to a prison for a maximum of five years, made to pay a fine, or both.
And although there is no information on actual convictions under the law, Kaleeswaram Raj, a lawyer for the petitioner, said the adultery law was "often misused" by husbands during matrimonial disputes such as divorce, or civil cases relating to wives receiving maintenance.
"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.
Interestingly, Indian folklore and epics are full of stories about extra-marital love. Most love poems in Sanskrit, according to scholar J Moussaief Masson, are "about illicit love".
But Manusmriti, an ancient Hindu text, says: "If men persist in seeking intimate contact with other men's wives, the king should brand them with punishments that inspire terror and banish them".
What did the judges say?
All five Supreme Court judges hearing the case said the law was archaic, arbitrary and unconstitutional.
"Husband is not the master of wife. Women should be treated with equality along with men," Chief Justice Misra said.
Judge Rohinton Nariman said that "ancient notions of man being perpetrator and woman being victim no longer hold good".
Justice DY Chandrachud said the law "perpetuates subordinate status of women, denies dignity, sexual autonomy, is based on gender stereotypes".
He said the law sought to "control sexuality of woman (and) hits the autonomy and dignity of woman".
The main concern, according to the respected journal Economic and Political Weekly, is "not whether the expectations of fidelity in a marriage are right or wrong, or whether adultery denotes sexual freedom."
"It is whether the state can and should monitor a relationship between adults that is too complex, sensitive and individual for it to be capable of doing in a just manner," the journal wrote in a recent editorial.
Where else is adultery a criminal offence?
Adultery is considered illegal in 21 American states, including New York, although surveys show that while most Americans disapprove of adultery, they don't think of it as a crime.
"The criminal statutes remain in force for largely symbolic reasons, and there isn't enough enforcement risk for anyone to incur the political costs of repealing them," Deborah Rhode, a professor of law at Stanford University and the author of Adultery: Infidelity and the Law told the BBC.
Adultery is prohibited in Sharia or Islamic Law, so it is a criminal offence in Islamic countries such as Iran, Saudi Arabia, Afghanistan, Pakistan, Bangladesh and Somalia.
Taiwan punishes adultery by up to a year in prison and it is also deemed a crime in Indonesia. In fact, Indonesia is drafting laws that prohibit all consensual sex outside the institution of marriage.
In 2015, South Korea's Supreme Court struck down a similar law where a man could be sent to prison for two years or less for adultery. The court said the law violated self-determination and privacy.
More than 60 countries around the world had done away with laws that made adultery a crime, according to Indian lawyer Kaleeswaram Raj.
In the UK, adultery is not a criminal offence and like many other countries, one of the main reasons given for divorce.
Couples cannot use adultery as a ground for divorce if they lived together as a couple for six months after the infidelity was known about.
Have there been previous challenges to the law?
In 1954, the law was first challenged by a petitioner asking why women cannot be punished for the offence, and that such "exemption was discriminatory".
The Supreme Court rejected the plea.
Since then, the top court has rejected similar pleas, including the constitutional validity of the law, at least twice - 1985 and 1988.
"The stability of marriage is not an ideal to be scorned," a judge said in 1985.
A married woman had approached the court, demanding the right to file a complaint of adultery against her husband's unmarried lover. The court, rather patronisingly, described the plea as a "crusade by a woman against a woman".
It said the law was about punishing the "outsider" who "breaks into the matrimonial home" and "violates its sanctity".
Two different panels on law reforms in 1971 and 2003 recommended that women should also be prosecuted for the offence.
"The society abhors marital infidelity. Therefore there is no good reason for not meting out similar treatment to the wife who has sexual intercourse with a married man," the 2003 panel, led by a judge, said.
In 2011, the top court, hearing another plea, said the law was facing criticism for "showing a strong gender bias, it makes the position of a married woman almost as a property of her husband".
What has the reaction been to the latest ruling?
Many Indians were not even aware the law existed. However, after Thursday's ruling, people have been largely supportive of the verdict.
Decriminalising of #Adultery is welcome and long overdue. Adultery is now grounds for divorce not crime. The law criminalising men for relations with some other man's wife was patriarchal, assumes wife is husband's property and has no autonomy. Good riddance #AdulteryVerdict— Kavita Krishnan (@kavita_krishnan) September 27, 2018
Court shows the way again ! Well done #CJI #DipakMisra- absolutely right. Adultery is grounds for divorce- but criminalizing consensual sexual and marital choices is State Over reach. The only time the State should be in your bedroom is if consent is missing. https://t.co/t4mhkFiKCI— barkha dutt (@BDUTT) September 27, 2018
Others said the top court should now move to make marital rape a criminal offence:
377- check— Nidhi Razdan (@Nidhi) September 27, 2018
Next step: make marital rape a crime
But a few felt that the law should have been made gender neutral instead of being struck down:
One line conclusion of SC take on #497 #Adultery law : Whenever society will demand that women also be punished for a crime that man is, they will strike the law itself down rather than making the offence gender neutral.— Deepika Bhardwaj (@DeepikaBhardwaj) September 27, 2018
MEN : You have absolutely no RIGHTS within a Marriage.
Now there is no meaning of marriage , the holy institution of marriage has been strikes down by the court .— Sourabh sharma (@theindianguy97) September 27, 2018