During the Meiji Period, the samurai class was gradually disbanded, and the Haitōrei Edict in 1876 forbade the carrying of swords in public except for certain individuals such as former samurai lords (daimyo), the military and police [REF].
During the pre World War II military buildup and throughout the war, all Japanese officers were required to wear a sword.