The attack on the French magazine Charlie Hebdo was an assault on democracy, on freedom and on the ideals that underpin all free societies. As we face the forces of extremism and terror, we must have the courage to speak up for those ideals and to safeguard the right to say what we believe. But we must also take care to respect the fact that others have the same right.

Charlie Hebdo is not the first publication to have suffered for publishing images that some perceived as offensive to Islam. In 2005, when I was prime minister of Denmark, the Danish newspaper Jyllands-Posten provoked international controversy by publishing 12 sketches of the prophet Muhammad. Some Muslims, in Denmark and abroad, accused Jyllands-Posten of blasphemy for publishing an image of the prophet.

Others said the images were an insult to Islam. There were calls for reprisals against the newspaper, against my government, and against Danish interests abroad.