In a victory for women’s rights in South Korea, the country’s top court ordered the government to decriminalize abortion Thursday, reforming a 66-year-long widespread ban on the procedure.

South Korea’s current laws governing abortion are some of the strictest in the developed world, criminalizing the practice in most cases, and only allowing for exceptions in cases of rape, incest or if a woman’s or girl’s health is endangered by the pregnancy. In these instances, abortions must be performed within the 24 hours and are subject to spousal consent. Women who terminate pregnancies can face fines of up to KRW 2 million ($1,850) or one year in jail, and medical professionals assisting with abortions can face prison terms of up to two years if convicted.

Thursday’s ruling by South Korea’s Constitutional Court was related to an appeal by a doctor who was prosecuted for carrying out 70 abortions between 2013 and 2017, the Associated Press reports. The court ruling ordered South Korea’s National Assembly to create legislation easing the current regulations by the end of 2020, calling the current abortion law incompatible with the constitution.

Women’s rights activists and campaigners rallied outside the court in scenes of jubilation when the ruling was announced, after demonstrations had taken place to protest the ban on March 30. The case has polarized debate in South Korea in recent weeks, with anti-abortion activists carrying placards featuring fetuses also rallying outside the court.

“Abortions will always happen, regardless of the law. This judgment means that they should be carried out safely and legally, and that women and girls are treated with compassion and respect for their human rights and their reproductive autonomy,” said Roseann Rife, Amnesty International’s East Asia Research Director, in a statement responding to the ruling. “Their dignity must be front and centre in any new legal framework on abortion.”

Contact us at letters@time.com.