The 48-year-old officer also suffered serious injury to his leg from an errant gunshot.
Both men were transported to a nearby hospital for treatment, police in the Hannover district of the German state of Lower Saxony said.
The attacker, who had a history of violent crime, died in the hospital.
Police said that before the incident the man had threatened his 22-year-old wife, telling her he would break the apartment door down.