When the Treaty of Peace and Amity between the United States and Japan was concluded in 1854, two ports, namely Shimoda and Hakodate, were opened to US merchant vessels in order to provide them with fuel and drinking water, and under the Treaty of Peace and Amity between England and Japan, Nagasaki and Hakodate were opened to England, but under these treaties foreigners were not permitted to reside in Japan.
1854年の日米和親条約では米国商船の薪水供給のため下田、箱館の二港が開港され、日英和親条約では長崎と箱館が英国に開港されたが、外国人の居住は認められなかった。