A 78-year-old cancer patient accused of killing his wife of nearly 50 years is out of jail after a North Dakota judge found he lacked criminal responsibility.

Matthias Zimprich was accused of killing his 74-year-old wife, Ludwina Zimprich, by hitting her in the head with a hammer more than a dozen times. The Bismarck man told authorities that he believed he must have killed her but had no memory of it.

Defense attorney Tom Dickson said Matthias Zimprich was undergoing aggressive cancer treatment and taking numerous medications.

South Central District Judge Bruce Romanick ruled earlier this month that Zimprich lacked criminal responsibility because of mental disease or defect. He was released from jail Friday.