Several times in Japanese history, the new ruler sought to ensure his position by calling a sword hunt (刀狩, katanagari). Armies would scour the entire country, confiscating the weapons of the enemies of the new regime. In this manner, the new ruler sought to ensure that no one could take the country by force as he had just done. The most famous sword hunt was ordered by Toyotomi Hideyoshi in 1588.
Prior to the sword hunt called by Oda Nobunaga towards the end of the 16th century, civilians were free to carry swords for defense or simply for decoration. Nobunaga sought an end to this, and ordered the seizure of swords and a variety of other weapons from civilians, in particular the Ikkō-ikki peasant-monk leagues which sought to overthrow samurai rule.
In 1588, Toyotomi Hideyoshi, having become kampaku or "imperial regent", ordered a new sword hunt; Hideyoshi, like Nobunaga, sought to solidify separations in the class structure, denying commoners weapons while allowing them to the nobility, the samurai class. In addition, Toyotomi's sword hunt, like Nobunaga's, was intended to prevent peasant uprisings and to deny weapons to his adversaries. This hunt may have been inspired by a peasant uprising in Higo the year prior, but also served to disarm the sōhei of Mount Kōya and Tōnomine. Toyotomi claimed that the confiscated weapons would be melted down and used to create a giant image of the Buddha for the Asuka-dera monastery in Nara.
"Taikō's Sword Hunt", as it came to be called, was accompanied by a number of other edicts, including the Expulsion Edict of 1590, by which Toyotomi sought to establish a census and expel from villages any newcomers who arrived in or after 1590. The chief goal of this was to place a check on the threat posed by rōnin, masterless wandering samurai who had the potential not only for crime and violence in general, but for banding together to overthrow Toyotomi rule. Hideyoshi, like most of this period, believed in rule by edict, paying little or no attention to legal principles.
While the Sword Hunt ostensibly succeeded in denying weapons to potential rebels, it also created discontent throughout the nation, increasing the number and passion of potential rebels.
The Meiji Restoration of the 1860s was the beginning of a period of major modernization and Westernization. In 1871, extensive reforms were passed and executed, abolishing the han system, and thus ending feudalism and the class system.
In 1876, samurai were banned from carrying swords. A standing army was created, as was a police force. This "sword hunt" was performed for, ostensibly, different reasons, and certainly with different methods than those of several centuries earlier. Ironically, perhaps, this sword hunt put an end to the class system while the earlier ones were intended to deepen the distinctions between commoners and nobles. Ultimately, however, the result of this sword hunt was the same as the results of its predecessors; the hunt ensured that the only weapons were in the hands of the ruling government and not available to potential dissenters.
Today, Japan has a Sword and Firearms Law which, much like gun control laws around the world, governs the possession and use of weapons in public. The purchase and ownership of certain swords within Japan is legal if they are properly registered, though the import and export of such items is tightly controlled, particularly in the case of items that might be labeled as national or cultural artifacts. Swords that are not produced by licensed smiths (including all machine-made swords) are prohibited for individuals. Japanese military swords are legal in Japan if they were made with traditional materials and methods.