A Hamas military judge was killed while a pistol was being cleaned in his office in Gaza City, the Hamas health ministry said Sunday.
A bullet was fired from the pistol and ended up in judge Ayman Emad Al-Deen's head, Xinhua quoted ministry spokesperson Ashraf Al-Qedra as saying.
It was not clear whether the judge was himself cleaning the pistol or it was being cleaned by someone else.
Police said an investigation was underway.
The judge, part of the Hamas military judiciary, was in the panel in charge of several tribunals that handed down death sentences against Palestinian informants accused of collaborating with Israel.
The Islamic Hamas movement took the Gaza Strip by force in 2007 after routing forces loyal to President Mahmoud Abbas out of the Palestinian coastal enclave.