The bill, which prohibits "inappropriate treatment of writings with significant religious importance for a recognised religious community", was passed with 94 votes in favour and 77 opposed in the 179-seat Folketing.
"We must protect the security of Denmark and the Danes. Therefore, it is important that we now have better protection against the systematic insults we have seen for a long time," Justice Minister Peter Hummelgaard said in a statement.
In practical terms, it will be forbidden to burn, tear or otherwise defile holy texts publicly or in videos intended to be disseminated widely.
Those who break the law, which will be evaluated after three years, risk a fine or up to two years in prison.
Over the summer, Denmark and neighbouring Sweden became the focus of anger across several Muslim countries after a slew of protests involving burnings and desecrations of the Koran.
Loophole is you can still shred and recycle it.