A court in South Korea has ruled that the country’s decades-old ban on abortion must be lifted, in a historic decision that sparked celebrations in Seoul.

Thursday’s decision by the constitutional court marks a major victory for pro-choice campaigners, 66 years after the country banned abortions in all but a few cases.

Under the current law, doctors who perform terminations can be imprisoned for up to two years, while women face a maximum one-year sentence or a fine of up to 2m won (£1,341).

The nine-member panel ruled by seven to two that a 1953 law banning abortion was unconstitutional and ordered the national assembly to revise it by the end of next year.

South Korea is one of the few developed countries that still criminalises abortions, with exemptions made for rape, incest, severe genetic disorders or when the mother’s health is in danger.

“The abortion ban limits women’s rights to pursue their own destinies, and violates their rights to health by limiting their access to safe and timely procedures,” the court said in a statement.

“Embryos completely depend on the mother’s body for their survival and development, so it cannot be concluded that they are separate, independent living beings entitled to the right to life.”

Outside the court, hundreds of women cheered and hugged as the announcement was made. “Women deserve to be happy as much as we want to be today,” said Bae Bok-ju, an activist. “Today’s decision was made because countless women ceaselessly fought for their rights for so many years. We deserve the world’s attention and we deserve its recognition.”

The court came close to scrapping the ban in 2012, with four justices voting in favour and four against. The ninth seat on the court was vacant.

On Thursday, the court said it had asked the national assembly to amend the law by the end of 2020, adding that the ban would be repealed if MPs failed to introduce new legislation by the deadline, according to the Yonhap news agency.

Anti-abortion activists shout slogans in front of the court in Seoul. Photograph: Kim Chul-Soo/EPA

The court said the new law should, under certain conditions, allow terminations in the early stages of pregnancy, according to Yonhap, and that doctors should no longer face criminal charges for carrying out the procedure.

The decision reflects growing support for women’s reproductive rights in socially conservative South Korea, where the church is a powerful influence.

A recent survey by the Korea Institute for Health and Social Affairs found that more than 75% of women aged 15 to 44 believed the law should be amended. In 2017, more than 230,000 people signed a petition to legalise abortion.

Authorities reportedly tolerated illegal terminations for decades after the ban was introduced, but began cracking down on terminations due to the country’s plunging birthrate.

South Korea’s health and welfare ministry estimated that about 169,000 illegal abortions were performed in 2010. But researchers say the social stigma attached to illegal abortions means the actual number could be as high as 500,000 in 2016.

A survey conducted last year by the Korean Women’s Development Institute found that one in five women who have been pregnant had had an abortion. Only 1% said they had a legal reason to terminate their pregnancy.

Critics have questioned the law’s effectiveness, given that so few people are prosecuted. Data shows that there have been just 15 indictments for abortion every year since 2015, with many defendants receiving suspended sentences, according to Yonhap.

But while prosecutions are rare, activists said criminalising abortions leaves women vulnerable to unsafe surgical procedures and blackmail by partners.

The South Korean president, Moon Jae-in, who is Catholic, has avoided commenting on the issue, but has pledged support for women’s rights in response to the rapid rise of the country’s #MeToo movement.

Moon, a liberal, appointed five of the current constitutional court justices, raising hopes that the abortion ban would be overturned, with the court’s chief justice among those who had come out publicly in favour of change.

Roseann Rife, Amnesty International’s East Asia research director, said: “Today’s ruling is a major step forward for the human rights of women and girls in South Korea. The country’s draconian laws have resulted in discrimination and stigmatisation for generations of women and girls by forcing them to undergo clandestine and unsafe abortions. The constitutional court has sent a clear message this must change, and in future the human rights of women and girls must be fully protected and respected.”

Agence France-Presse contributed to this report.