WARSAW, Poland — Tens of thousands of people marched Friday through downtown Warsaw to the house of Poland’s ruling party leader in what women’s rights activists planned as the largest demonstration in nine days of protests against a near-total ban on abortions in Poland.

There were cases of far-right activists and soccer hooligans emerging from side streets and firing flares on people taking part in the “March on Warsaw.” Warsaw police said they detained around a dozen people.

However, much of the march proceeded peacefully and even in a festive spirit, with people dancing as vans blared music.

The protests were triggered by an Oct. 22 ruling by Poland’s constitutional court that abortion in cases of severe fetal deformities was unconstitutional. The ruling further restricts what was already one of Europe’s more restrictive abortion laws.

Warsaw mayor Rafal Trzaskowski, of the opposition Civic Platform party, joined the marchers and called for dialogue between the protesters and the government. His office later estimated the crowd at 100,000.

Families with children took part in the march early on, joining mostly young, even teenage protesters who chanted slogans calling for the government to step down and for women to have freedom of choice. Many carried homemade cardboard signs, many serious, others playful.

A car that drove in the procession had signs on its windows that said: “I wish I could abort my government,” and “Even Shrek wouldn’t want to live in such a swamp.”

Many also chanted obscenities against the conservative government, in what has been a distinguishing feature of these nine days of street protest.

As in previous days, protests also took place in some other Polish cities.

The march headed for the house of the right-wing ruling party leader Jaroslaw Kaczynski, but police blocked the street at some distance from the house. It was not clear if Kaczynski was at home.

He is the most powerful politician in the country despite having only the government role of deputy prime minister. He has long supported a total ban on abortion and he is being blamed now for being behind the court ruling, issued by party loyalties.

“Kaczynski set fire to Poland,” said one sign held up at Warsaw’s protest.

Protesters ignored pandemic restrictions which ban public gatherings of more than five people, and disregarded government calls to stay home due to skyrocketing coronavirus infections. The nation of 38 million has hit new records for confirmed cases almost daily this week, including the 21,600 confirmed cases reported Friday.

The national public prosecutor threatened criminal charges against protest organizers for “causing an epidemiological threat,” a charge that carries a prison sentence of up to eight years.

Klementyna Suchanow, one of the key organizers with the Poland’s Women’s Strike initiative, said she and many others refused to be deterred by either the virus or the authorities because they believe they are fighting for a fundamental right.

“This is about the freedom and dignity of people,” Suchanow said. “The will of people to protest should be a lesson for anyone who wants to impose authoritarian ways.”

Poland’s abortion law was forged by political and Catholic Church leaders in 1993. It allowed abortion only in the cases of fetal defects, risk to the woman’s health and pregnancies resulting from crimes — incest or rape.

The recent ruling leaves only the woman’s health or pregnancy resulting from crimes as legal reasons for abortion.

Earlier attempts by the country’s conservative ruling party to change the law to ban all abortions also prompted enormous street protests, including in 2016 and 2017.

This time, Kaczynski appears to have calculated that he could change the law with less of a backlash by getting a court under his control to do it during the pandemic. If that was the case, the plan has backfired for now, though it remains unclear how long the protests will keep their momentum.

The protests have included people disrupting church services and spray-painting slogans on churches last Sunday. Such actions and vulgarity have offended many people in the largely Catholic nation, even some who disagree with the court ruling.

Kaczynski has since called on supporters to defend churches.

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

Monika Scislowska in Warsaw contributed to this report.