Police in the Bavarian city of Kempten said the man had opened fire on an elite task force who were trying to raid his home. His wife, from whom he separated, had called for help because of family problems.
When police tried to contact him to speak with him face to face, he allegedly threatened them with a gun and threatened to kill himself or others.
A commando unit then stormed the house in the town of Weissenhorn, and in the ensuing exchange of gunfire, the man died.