Sakoku

Sakoku (Japanese: 鎖国, literally "country in chains" or "lock up of country") was the foreign policy of Japan under which no foreigner or Japanese could enter or leave the country on penalty of death. The policy was enacted by the Tokugawa Shogunate under Tokugawa Iemitsu through a number of edicts and policies from 1633-1639 and remained in effect until 1854 with the arrival of Commodore Matthew Perry and the opening of Japan. It was still illegal to leave Japan until the Meiji Restoration (1868).
But Japan was not completely isolated under the "sakoku" policy. Rather, it was a system in which strict regulations were applied to commerce and foreign relations by the shogunate.
End of seclusion.
On July 8, 1853, Commodore Matthew Perry of the U.S. Navy with four warships demanded that Japan open to trade with the West. 
The following year 1854, Perry returned with seven ships and forced the Shogun to sign the "", establishing formal diplomatic relations between Japan and the United States.