The Yi dynasty in Korea began in 1392 when Yi Songgye ascended the throne by overthrowing the Koryo dynasty. The Yi dynasty lasting for 5 centuries was one of the world's longest lasting monarchies. From their capital at Hanseong (modern-day Seoul) Yi rulers consolidated their rule of Korea. They patterned their society after that of the Chinese but maintained their distinctive identity. The Yi dynasty was not to last forever. It was severely weakened during the late 16th and 17th centuries and there were disruptive divisions within its elite classes. A Japanese force under Toyotomi Hideyoshi invaded Korea in the late 16th century. The Japanese invaders were defeated and Koran farmlands were devastated. In response to these events, the Korean rulers sought to limit contact with foreign countries and tried to keep the country isolated from the outside world. The country remained untouched by European merchants and Christian missionaries. Due to its isolationist practices, Korea earned the name "the Hermit Kingdom."