State prosecutors in Saxony-Anhalt said that the robber burst into a betting shop in Naumburg, southeast of Leipzig, early this morning before threatening an employee with a knife.
They could not say whether the man was attempting to rob the gambling hall.
Police were called to the scene, which took place inside a shopping centre, at around 4 am.
A group of onlookers had gathered in front of the building and the man became violent when officers arrived, attacking police and bystanders with his knife.
Two officers suffered knife wounds, but one of them drew his weapon and shot the attacker dead, a spokesman for state prosecutors said.
"Our understanding so far is that the suspect continued slashing at people around him with the knife. One of the officers called to the scene drew his weapon and fired a shot – with deadly effect," chief state prosecutor Hans-Jürgen Neufang told Bild.
Police have also yet to confirm the identity of the dead man.
His body will undergo an autopsy to determine the exact effect of the police officer's bullet.
Police shootings are rare in Germany, usually numbering fewer than ten each year.