WARSAW, Poland — Poland’s top court ruled Thursday that a law allowing abortion of unborn children with congenital defects is unconstitutional, shutting a major loophole in the predominantly Catholic country’s abortion laws that are among the strictest in Europe.

Two judges in the 13-member Constitutional Court did not back the majority ruling. Activists deplored the decision, and the Council of Europe’s human rights commissioner wrote on Twitter that it was a “sad day for women’s rights.”

The decision came in response to a motion from conservative lawmakers who argued that terminating a pregnancy due to fetal defects — the most common reason cited for legal abortions in Poland — violates a constitutional provision that calls for protecting the life of every individual.

The court argued that terminating pregnancy due to defects of the unborn child amounted to eugenics — a 19th century notion of genetic selection that was later applied by the Nazi Germans in their pseudo-scientific experiments.

It agreed with the plaintiffs that it was a form of banned discrimination when the decision about an unborn child’s life was conditioned on its health.

The challenged law was introduced by Poland’s young post-communist democracy in 1993 as a hard-won compromise between the influential Catholic Church and the state authorities. It allows abortions when a pregnancy endangers a woman’s health or life, or results from rape or other illegal act, and also in case of congenital defects. Only the last provision was challenged.

Even before Thursday’s ruling, many Polish women have sought abortions abroad.

Health Ministry figures show that 1,110 legal abortions were held in Poland in 2019, mostly because of fetal defects.

In justifying its decision, the court said “there can be no protection of the dignity of an individual without the protection of life.”

The verdict was announced by the court’s president, Julia Przylebska, a loyalist of the conservative government that is focused on family and Catholic values. Przylebska’s appointment to the court in 2015 was one of the government’s first steps toward taking control of the judiciary.

Archbishop Marek Jedraszewski, known for his strong conservative views, hailed the verdict and expressed “great appreciation for the courage” of the judges in the defense of human life “from the moment of conception to the (moment of) natural death.”

But opposition lawmakers lashed out.

The head of the Civic Coalition, Borys Budka, said on Twitter that the government used a “false” court of its own appointees to do something “simply inhuman.”

Council of Europe Commissioner for Human Rights Dunja Mijatović deplored the decision.

“Removing the basis for almost all legal abortions in #Poland amounts to a ban & violates #HumanRights,” she tweeted. “Today’s ruling of the Constitutional Court means underground/abroad abortions for those who can afford & even greater ordeal for all others. A sad day for #WomensRights.”

Former European President and Poland’s former prime minister, Donald Tusk, criticized the timing of such key ruling during the difficult time of the pandemic.

Police guarded the court’s building as groups of pro-choice rights and pro-life activists gathered outside as the verdict was announced. The groups were small, because anti-COVID-19 regulations ban gatherings of more than 10 people.

One of the judges who did not back the ruling, Leon Kieres, argued he was mindful of the situation and condition of women when deprived of the right to decide about a pregnancy with defects.

Polish lawmakers considered legislation earlier this year that would have imposed a near-total ban on abortion by outlawing the procedure in cases of fetal abnormalities, even when the unborn child has no chance of survival. They ended up postponing a final vote on the proposal brought by a Catholic group. Similar efforts also were mothballed in the past following mass nationwide protests that are not possible now under the anti-COVID-19 regulations.