South Korea has abolished a 62-year-old law that bans extramarital affairs after ruling that the law suppresses personal freedom.

A Constitutional Court official said the ruling could potentially affect thousands people who face a trial or have already been found guilty of breaking the law since late 2008, when the court previously upheld the adultery ban.

Under the law, having sex with a married person who is not your spouse was punishable by up to two years in prison. Nearly 53,000 South Koreans have been indicted on adultery charges since 1985, but prison terms have been rare.

Supporters of the law say it promotes monogamy and keeps families intact, while opponents argued that the government has no right to interfere with people's private lives.

Current charges could be thrown out and anyone given a guilty verdict would be eligible for a retrial, according to a court official.

The debate over the adultery ban, which has been part of South Korea's criminal law since 1953, intensified in recent years as fast-changing social trends challenged conservative traditional values.

Seven judges of the court, which rules on the constitutionality of laws, supported the ruling, while two dissented. The support of six judges is needed to abolish a law.