A man previously convicted over a plot to kill a former Iraqi prime minister during a 2004 visit to Berlin has been shot dead by police in the German capital, officials say.

The 41-year-old man, named as Rafik Y, was threatening pedestrians with a knife in the street in Heerstrasse in Berlin's Spandau district.

The man seriously injured a female officer before another officer shot him dead, according to police.

"A male has injured our female colleague in Spandau earlier today during an effort to detain him," Berlin police said on Twitter. "Afterwards her colleague shot and wounded the attacker. The injury resulted in his death. The health condition of our colleague is stable. She is in intensive care."

The Berliner Morgenpost reported that Rafik Y, an Iraqi, was found guilty in 2008 over a 2004 plot to kill the former Iraqi prime minister, Iyad Allawi, during a visit to Germany.

"The deceased was identified. He was a convicted offender out on bail," Berlin police said on Twitter. "He was sentenced for membership of terrorist organisation and his part in an assassination plot against the Iraqi Prime Minister." 

Rafik Y had been freed on bail and ordered to wear an electronic tag, which he had removed before the attack.

Source: Al Jazeera and agencies