The prime minister told Heart radio that it would be wrong for newspapers and other media to appease the “fanatical death cult of Islamist extremism” by holding back from publishing anything within the confines of the law.

Asked about his reaction to the new Charlie Hebdo front cover, Cameron said: “I wasn’t at all surprised because, when your freedom of expression is attacked in this way, I don’t think it’s surprising people want to stand up and fight for the freedom of expression they believe in. I think it’s right we all hold that view. Even if there are people – and there will be many Muslims who are offended by a depiction of the prophet – being offended by something is not a justification for violence.

“I am a Christian. I obviously do not like seeing the religious things I hold dear mocked in an unpleasant way. But, in a free country, if people want to attack my religion and my beliefs, you accept that because it’s part of living in a free country.”

The prime minister made the comments after Charlie Hebdo revealed its new front cover featuring the prophet against a green backdrop. A tear rols down his face as he holds a sign which reads “je suis Charlie”, and above him, the headline reads “all is forgiven” in French. The magazine is printing 3m copies instead of its usual print run of 60,000.

Asked whether UK outlets that reproduce the image were putting themselves at risk, the prime minister said: “I think we are at risk because there are a group of people who believe in this fanatical death cult of Islamist extremism. You can’t appease them; they hate our democracy, our freedom, our freedom of expression, our way of life. It would be wrong to think there are a set of behaviours we could adopt to make us safer.

“I don’t think that is right. We believe in freedom. It’s a very important part of our country. It is not for politicians to tell magazines or television stations or radio stations what they should or shouldn’t publish. It is up to us to defend your right to publish what you believe is right within the confines of the law. Sometimes that will mean offending people.”

Ten Charlie Hebdo staff and two police officers were killed in the attack on the magazine by Islamist extremists. A further four hostages were murdered during the siege of a kosher supermarket in Paris.