Denmark's parliament has banned the "inappropriate treatment" of religious texts - with a bill widely known in the country as the Quran law, according to BBC.
Offenders now face a fine or up to two years in jail after a 94-77 vote.
It follows a series of burnings of Islam's holy book that led to uproar in Muslim countries.
Denmark and neighbouring Sweden have recently seen a number of street protests over such incidents, raising security concerns in Scandinavia.
But the country's centre-right coalition government of Prime Minister Mette Frederiksen argued that criticising religion would remain legal, as the bill would only have a marginal impact.
Back in August, when the government was proposing the changes, ministers said they wanted to send a signal to the world after witnessing over a few weeks 170 demonstrations, including Quran burnings in front of foreign embassies.
The government in Stockholm is currently considering a similar bill.
Both Denmark and Sweden have abolished blasphemy laws.