COPENHAGEN - A Danish police officer was in hospital Tuesday after an "unstable" man who apparently acted alone shot him in the head at a police station outside Copenhagen, authorities said.

According to Danish media, the officer was a police dog handler, while the suspect was known to have attacked police officers in the past.

"Everything leads us to believe that the perpetrator acted alone and that it was the act of an unstable person," police inspector Mogens Lauridsen told reporters.

Police did not directly address whether the case had terror links, but by midday security at police stations across the country had returned to the normal level. A 26-year-old man known to police was arrested.

The officer was in "serious condition but according to doctors his life is not in danger," police said in a statement.

The attacker shot the officer as he was arriving for duty at 8:20 am (0720 GMT) in Albertslund, a disadvantaged town west of the capital.

Prime Minister Lars Lokke Rasmussen and Justice Minister Soren Pape denounced the shooting.

Tuesday's incident was the second time this year that a police officer has been shot.

On August 31, a Danish sympathiser of the Islamic State group (IS) fired on two police officers conducting a drug raid in Copenhagen's Christiania district, hitting one in the leg and the other in the head.

And in February 2015, four police officers were injured in the deadly twin attacks committed by a young Dane of Palestinian origin against a cultural centre hosting a debate on freedom of expression and the Copenhagen synagogue.