Japanese police on Friday detained a man who had holed up in a building after allegedly killing four people, including two police officers, in a gun and knife attack.Local media said he then fired what has been described as a hunting gun at police officers who arrived at the scene.