Viewpoint: Denmark prepared for attack but nowhere is safe
Denmark's security services had already assessed the threat the country faced - and this weekend that assessment became a ruthless reality.
Two innocent civilians were cynically executed, five police officers were wounded by gunfire, and later an alleged offender was shot dead by the police.
The Danish police and National and Intelligence Service (PET) have long prepared and trained for a possible terror attack, not least drawing on the hard-earned experience of the UK's MI5 and the Metropolitan Police after the London bombings of 7 July 2005.
But there has not been a fatal terror incident in Denmark for 20 years, and many Danes were immersed in a fairytale notion of living in complete safety.
With the Copenhagen shootings, Denmark's innocence has been bruised and we are all in shock.
The two attacks replicated the terror directed at the French satirical magazine Charlie Hebdo in Paris.
The Danish copycat gunman, named locally as Omar El-Hussein, followed the same modus operandi and aimed his desire for revenge against the exact same symbolic targets as the French gunmen.
The attackers all sought revenge for the insulting depiction of the Prophet Muhammad, the Israeli occupation of the Palestinian territories and the actions of police, who represent what they see as the state oppression of Islam.
The information available so far also indicates that the profile of the Danish perpetrator is very similar to those in France - a young, frustrated and maladapted criminal, who was radicalised in prison and convinced that being a "holy warrior" was both heroic and prestigious.
This is an aspect that no security and intelligence service should forget or ignore in their search for Islamist extremists.
It is indisputable that Denmark, after the publication of the cartoons of the Prophet Muhammad, was added to the terrorists' map of preferred targets.
PET has since operated with an elevated terror threat level, corresponding to the UK's "severe" level.
Denmark's intelligence services are known for a broad preventive approach to counter-terrorism activities.
One initiative is the establishment of contact groups aiming to urge representatives from ethnic minority groups in Denmark to share the responsibility to prevent terror.
These groups see PET officers meet imams on a regular basis to discuss the joint efforts.
So-called preventative talks are also used when PET recognises that a young person is at risk of being radicalised.
In short, the aim of these measures is to aid the person in question to escape the hateful thought pattern that breeds extremists.
Most of the time PET actually succeeds in preventing these young people from pursuing violent fundamentalism - but some individuals are beyond reach.
The security in place around potential terror targets in Denmark has been significantly increased.
But the notion of a safe haven in today's society is a delusion.
Guarantees of total safety from terror cannot be given anywhere - not even in a totalitarian system.
The UK knows this and now Denmark knows it - just as we all know that our police forces and our intelligent services are doing everything humanly possible to counteract and prevent terror.
From my service as detective commander and head of operation in PET, I know that keeping our citizens safe is its most important goal.
Tackling Islamic fundamentalism is a challenge - but the security services are determined to succeed.