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.