The Gaikoku bugyō system began just prior to the negotiations which resulted in the Harris Treaty. First appointed in August 1858, the gaikoku-bugyō were shogunate officials who were charged with advising the government on foreign affairs and who were tasked with conducting negotiations with foreign diplomats both in Japan and abroad. This was a high-ranking office, in status roughly equivalent to that of kanjō-bugyō, or expressed differently, the status of this office ranked slightly below that of daimyō. The number of gaikoku bugyō varied, from five in 1858 to a maximum of 13, with wide variations in the numbers of officials who were appointed across the span of years. The office was often held concurrently with that of kanjō-bugyō or the office was held concurrently by those serving the shogunate as governor of one of the great ports. The Gaikoku bugyō system ended in 1869 when the new Meiji government was formed; but some of the foundational work of this period proved useful to the nascent Ministry of Foreign Affairs. Some 70 Gaikoku bugyō commissioners were named during this significant period. Hotta succeeded Abe Masahiro, and in his years at the post had to address the issue of the Harris Treaty of 1858. The genesis of the gaikoku-bugyō pre-dates the actual creation of the office.
''Kaibō-gakari''
The prefix kaibō-gakari meaning "in charge of maritime defense" was used with the titles of some shogunate officials after 1845. This term was used to designate those who bore a special responsibility for overseeing coastal waters, and by implication, for dealing with matters involving foreigners—for example, kaibō-gakari-ōmetsuke which later came to be superseded by the term gaikoku-gakari.
''Gaikoku-bōeki-torishirabe-gakari''
RōjūHotta Masayoshi formed an ad hoc committee of shogunate officials with special knowledge of foreign affairs, and he himself headed this working group. In November 1856, he appointed the members and charged them to come up with recommendations about the terms for opening Japanese ports. The results of their deliberations would become the basis for negotiations which ultimately resulted in the Harris Treaty.