The Emperor himself lived in Kyoto from 794 to 1868 as capital of Japan. During the Edo era, the city enjoyed a prolonged period of peace known as the Pax Tokugawa, and in the presence of such peace, Edo adopted a stringent policy of seclusion, which helped to perpetuate the lack of any serious military threat to the city.