Former head of MI6 Sir John Sawers has appeared to back the Pope's comments to journalists about the consequences of insulting another person's religion.
Referring to the Charlie Hebdo attacks in Paris, Pope Francis said that someone who insulted his mother "can expect a punch on the nose", adding: "It's normal. You cannot provoke. You cannot insult the faith of others. You cannot make fun of the faith of others."
Pope Francis was widely criticised for the remark, including by Prime Minister David Cameron. However, in his first speech since leaving office, Sawers said: "I rather agree with the Pope that, of course, the attacks in Paris were completely unacceptable and cannot be justified on any basis whatsoever, but I think respect for other people's religion is also an important part of this.
"If you show disrespect for others' core values then you are going to provoke an angry response. That doesn't justify anything, but I think we just need to bear it in mind."
Sawers warned that another terrorist attack on the UK was inevitable, saying: "If I was to sit here and say will the goalkeepers of the security services and the police keep every single attempt to get the ball into the net, out? No. At some point these threats will get through and there will be another terrorist attack in this country."
Reflecting on the security leaks by Edward Snowden, he said that it was vital that the internet was open to scrutiny by the security services: "We cannot have no go areas in our communities where the police cannot go, because that just allows space room for the evil-doers to ply their trades.
"It is the same in the virtual world. If you allow areas which are completely impenetrable then you might feel comfortable that your communications are private and no one else can see them, but so are those who are trying to do you down and undermine your society."
However, he said: "I do not believe that there is a trade-off between security and privacy. I think they go together.
"If you have a society which evades and abuses privacy, then ultimately there will be a reaction against the damage to your security. If you do not have any security then all your basic freedoms are at threat."