COPENHAGEN, Denmark (AP) — A new law was passed in Denmark's parliament on Thursday that makes it illegal to desecrate any holy text in the country, after a recent string of public desecrations of the Quran by a handful of anti-Islam activists sparked angry demonstrations in Muslim countries.

The Scandinavian nation has been viewed abroad as a place that facilitates insults and denigration of the cultures, religions and traditions of other countries. The purpose of the law was to counter “the systematic mockery” which, among other things, has contributed to intensifying the threat of terrorism in Denmark, the justice ministry has said.

“We must protect the security of Denmark and Danes," Justice Minister Peter Hummelgaard said in a statement. "That is why it is important that we now get better protection against the systematic desecrations we have seen for a long time.”

The Folketing, or parliament, adopted the law in a 94-77 vote, with eight lawmakers absent. The new legislation will make it a crime “to inappropriately treat, publicly or with the intention of dissemination in a wider circle, a writing with significant religious significance for a religious community or an object that appears as such.” Works of art where “a minor part” includes a desecration, but is part of a larger artistic production, isn't covered by the ban.

During the more than four-hour debate, left-leaning and far-right parties united against the center-right government, repeatedly demanding that the three-party coalition that presented the draft on Aug. 25, take part in the discussion. The government didn't say anything and were called “cowards” by the opposition.

“Does Iran change its legislation because Denmark feels offended by something an Iranian could do? Does Pakistan? Does Saudi Arabia? The answer is no,” Karina Lorentzen of the Socialist People's Party asked rhetorically. Inger Støjberg of the anti-immigration Denmark Democrats said that the new law was a capitulation to Islam and a bowing down to countries that “do not share (our) set of values.”

“A restriction of freedom of expression is wrong in a modern and enlightened society like the Danish one,” Støjberg said.

This year alone, activists have staged more than 500 protests, including burnings of the Quran, in front of embassies of Muslim countries, places of worship and in immigrant neighborhoods.

Denmark has repeatedly distanced itself from the desecrations, but has insisted that freedom of expression is one of the most important values in Danish society. The government has said there must “be room for religious criticism” and that there were no plans to reintroduce a blasphemy clause that was repealed in 2017.

Oussama Elsaadi, an iman with a mosque in Denmark's second-largest city Aarhus, told the B.T. newspaper that it's “a good message to all Muslims.”

“Burning of the Quran is an offense to others,” he said, according to B.T. “You may express yourself as you wish, but not in such a way that you destroy other people’s lives.”

In 2006, Denmark was at the center of widespread anger in the Muslim world after a Danish newspaper posted 12 cartoons of the Prophet Muhammad, including one wearing a bomb as a turban. Muslims consider images of the prophet to be sacrilegious and encouraging of idolatry. The images escalated into violent anti-Denmark protests by Muslims worldwide.

Those who violate the new law face fines or up to two years in prison. Before it takes effect, Denmark's figurehead monarch Queen Margrethe needs to formally sign it. That is expected to happen later this month.

In neighboring Sweden, which also has seen a string of Quran burnings and requests to stage protests involving the destruction of holy books, a government-appointed investigation will establish whether to review the police ordinance, the Swedish news agency TT wrote.

Swedish police should be able to weigh threats to the nation’s security during the examination of an application for a public assembly where the desecration of a holy book is included, and is set to be completed by July 1 next year, TT said.

There is no law in Sweden specifically prohibiting the burning or desecration of the Quran or other religious texts. Like many Western countries, Sweden doesn’t have any blasphemy laws.

The clash of fundamental principles has complicated Sweden’s desire to join NATO, an expansion that gained urgency after Russia’s invasion of Ukraine but needs the approval of all current members. Turkey has blocked Swedish accession since last year, citing reasons including anti-Turkish and anti-Islamic protests in Stockholm.

Copyright 2023 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.