The oyatoi gaikokujin (JapaneseKyūjitai: 御雇ひ外國人, Shinjitai: お雇い外国人, "hired foreigners") -- sometimes rendered o-yatoi gaikokujin in romaji, were foreign advisors hired by the Japanese government for their specialized knowledge to assist in the modernization of Japan at the end of the Bakufu and during the Meiji Era. The total number is uncertain, but is estimated to have reached more than 3,000 (with thousands more in the private sector).
The goal in hiring the foreign advisors was to obtain transfers of technology. The foreign advisors were highly paid; in 1874, they numbered 520 men, during which time their salaries came to ¥2.272 million, or 33.7 percent of the annual budget. Despite the value they provided in the modernization of Japan, the Japanese government did not consider it prudent for them to settle in Japan permanently. After training Japanese replacements to take over their places, many found that their contracts (typically for three years) were not renewed.
Some foreign advisors supplemented their activities as government employees by undertaking Christianmissionary activities.
The system was officially terminated in 1899 when extraterritoriality came to an end in Japan. Nevertheless similar employment of foreigners persists in Japan, particularly within the national education system and professional sports. Until 1899, more than 800 hired foreign experts continued to be employed by the government, and many others were employed privately.