BERLIN: German police shot dead a knife-wielding Iraqi in a refugee shelter who was attacking a Pakistani he suspected of having sexually abused his young daughter, police said Wednesday.

The 29-year-old Iraqi died after being hit by several police bullets late Tuesday in the asylum seekers' shelter in the central Berlin district of Moabit.

Police were called to the shelter after the 27-year-old Pakistani man allegedly sexually abused an eight-year-old girl in a nearby park, BZ daily reported.

When police detained the suspect and led him away in handcuffs, the girl's father lunged at him with a knife, yelling "you won't survive this", according to witnesses.

He was cut down by several police bullets and died hours later in hospital.

The alleged sexual attacker remained uninjured. The girl and her mother were undergoing counselling.

Police did not immediately release the personal details of those involved.

An internal police enquiry was launched, a routine step after deadly shots have been fired, while the police union warned against condemning the officers involved.

"The officers had to prevent an act of vigilante justice and a situation that was life-threatening for them," said the union's Berlin chief Bodo Pfalzgraf.

He reiterated a union demand that police be equipped with electric stun guns, saying "police don't want to kill but are forced to if the government doesn't give them other operational means".

Germany last year took in one million asylum seekers, around half of them from war-torn Syria, Iraq and Afghanistan, housing them in hostels, sports gyms, army barracks and other facilities nationwide.