Danish police on Tuesday arrested a Palestinian man suspected of stabbing a policeman at the country's largest reception centre for asylum seekers, which had sparked a manhunt in the area.
The officer was critically wounded after being stabbed three times in the stomach, but after surgery his condition was stable.
"The case is being investigated as an attempted homicide," local police said in a statement.
The suspect was a stateless Palestinian refugee born in 1990 who was about to be deported from the country. It is unclear how long he has spent in Denmark, or where the authorities planned to deport him to.
Earlier in the day a large area had been cordoned off around the former military barracks at Center Sandholm, Denmark's largest facility for asylum seekers, which currently houses around 600 people.
The centre, which lies around 20 kilometres (12 miles) northwest of Copenhagen, receives newly-arrived asylum seekers as well as those who have had their applications rejected and are due to leave the country.
Since Europe's refugee crisis began spilling into Denmark on September 6, at least 17,700 migrants have entered the country, according to police figures, but most have continued to neighbouring Sweden which has a more generous asylum policy.
Over the past three weeks, around 100 people have been applying for asylum each day, the Danish Immigration Service said.