South Korea’s Constitutional Court on Thursday struck down a 62-year-old law that made adultery an offense punishable by up to two years in prison, citing the country’s changing sexual mores and a growing emphasis on individual rights.

“It has become difficult to say that there is a consensus on whether adultery should be punished as a criminal offense,” five of the court’s nine justices said in a joint opinion. “It should be left to the free will and love of people to decide whether to maintain marriage, and the matter should not be externally forced through a criminal code.”

In their opinion, the five justices also said they doubted that the law was still useful in preventing adultery. Instead, they said, it has often been used by spouses to force a divorce or by those outside the marriage to blackmail married women who have cheated on their husbands. (The stigma of adultery is greater for women, making it harder to blackmail men who have committed adultery.)

An estimated 53,000 South Koreans have been indicted under the law since the authorities began keeping count in 1985. But in recent years, it has been increasingly rare for defendants to go to prison, in part because courts have demanded stronger proof that sexual intercourse occurred. In many cases, police officers, tipped off by a spouse, have raided motel rooms.