In feudal Japan, individual military and citizens groups were primarily responsible for self-defense until the unification of Japan by Tokugawa Ieyasu in 1603. During the Edo period (1603–1868), the Tokugawa shogunate formed a centralized feudal government.Samurai warriors who once protected Japan from foreign enemies and fought each other for supremacy became the new police and internal security force. Their new job would be to ensure civil peace, which they accomplished for over 250 years.
During the Edo period the authoritarian Tokugawa shogunate instituted an elaborate police/security state, an administrative hierarchy was developed, and rules and regulations controlling many aspects of life in Japan went into effect. This new system of government has been called a police state, possibly the world's first.
In 1868 the samurai era ended with the overthrow of the Tokugawa shogunate and a new government came into power (Meiji government) and the samurai class was eventually abolished. In 1872, a former samurai [Kawaji Toshiyoshi] was sent to Europe to study systems of policing and he recommended a restructuring based partially on French and Prussian systems. In 1874, a nationalized police force was created using European police systems as a model. This new police force was the start of the modern police system in Japan, though it was initially dominated by former samurai from Satsuma who were part of the driving force behind the removal of the Tokugawa shogunate. The new Meiji period police continued the Edo period method of Japanese police controlling societal behavior and internal security as well as preventing and solving crimes.
The Edo period police apperatus utilized a multi-layered bureaucracy which employed the services of a wide variety of Japanese citizens. High and low ranking samurai, former criminals, private citizens and even citizens groups (Gonin Gumi) participated in keeping the peace and enforcing the laws and regulations of the Tokugawa shogunate.
During the Edo period, high ranking samurai with an allegiance to the Tokugawa shogunate (hatamoto) were appointed machi-bugyō (city administrators or commissioners). The machi-bugyō performed the roles of chief of police, prosecutor, judge and other judicial related business both criminal and civil in Edo and other major towns.