The head of Germany's internal security service has quit over a botched investigation into a neo-Nazi terrorist group involved in a killing spree that shocked the nation.

Heinz Fromm announced on Monday that he had decided to step down amid will take early retirement at the end of the month.

The spy chief, who had been in the job since 2000, had come under severe pressure over his handling of an investigation into the self-styled National Socialist Underground (NSU). The three-person cell murdered nine men of immigrant background and a policewoman between 2000 and 2007 as well as injuring 20 in bombings and conducting a string of bank robberies but were never caught.

Its career in violence only came to an end last year after two members committed suicide following a failed bank raid and the surviving member handed herself in.

Fromm's agency attracted severe criticism over its handling of the case, and last week faced an outburst of anger following the revelation it had shredded files on the far-right gang after its discovery.

But Hans-Peter Friedrich, the German interior minister, stressed that the retiring spy chief had been an able servant for the country.

"The circumstances in connection with the NSU must not be allowed to overshadow that the domestic intelligence agency has enjoyed enormous success in making Germany safer in the past years under President Fromm's leadership," he told reporters in Berlin. "For this I would like to sincerely thank Mr. Fromm, whose personal integrity is beyond doubt."