In February, an Islamist gunman opened fire at a free speech seminar and then at a synagogue, killing two civilians and injuring several police officers in Copenhagen.
"It has been an exciting challenge to head the Danish Security and Intelligence Service over the last year and a half. After careful consideration, I have agreed with the permanent secretary of the Ministry of Justice and the National Commissioner of Police, that I now wish to take on new tasks to develop the Danish police," Madsen said in a statement published on the justice ministry's website.
The PET had reportedly been informed that the suspected criminal behind the shootings, 22-year-old Omar El-Hussein, was possibly radicalized while serving his term in prison. However, there were no grounds to suggest he would carry out terror attacks, Danish intelligence stated.
Following the February assaults, Danish police launched a major search operation in Copenhagen and stepped up security measures across the country, while local security agencies focused on prevention and dismantling extremists' attacks.