Bugyō (奉行), often translated as "commissioner" or "magistrate" or "governor", was a title assigned to samurai officials of the Tokugawa government in feudal Japan; other terms would be added to the title to describe more specifically a given commissioner's tasks or jurisdiction.
In the Heian period (794–1185), the post or title of bugyō would be applied only to a set task; once that task was complete, the officer would cease to be called bugyō. However, in the Kamakura period (1185–1333) and later, continuing through the end of the Edo period (1603–1868), posts and title came to be created on a more permanent basis. Over time, there came to be 36 bugyō in the Kamakura bureaucracy.
In 1434, Ashikaga Yoshinori established the Tosen-bugyō to regulate foreign affairs.
In 1587, a Japanese invading army occupied Seoul; and one of Hideyoshi's first acts was to create a bugyō for the city, replicating a familiar pattern in an unfamiliar setting.
During the Edo period, the numbers of bugyō reached its largest extent. The bureaucracy of the Togukawa shogunate expanded on an ad hoc basis, responding to perceived needs and changing circumstances.
In the early years of the Meiji Restoration, the offices and conventional practices remained in place during the initial period when nothing else had been contrived to replace the existing Tokugawa system. For example, the commander-in-chief of artillery under the early Meiji government was called the Hohei-bugyō.