After enjoying a period of peace for nearly two centuries, the Joseon dynasty faced foreign invasions and internal factional strife from 1592 to 1637. Most notable of these invasions is the Japanese invasions of Korea, which marked the end of the Joseon dynasty's early period. The combined force of Ming dynasty of China and the Joseon dynasty repelled these Japanese invasions, but at cost to the countries. Henceforth, Joseon gradually became more and more isolationist and stagnant. By the mid 19th century, with the country unwilling to modernize, and under encroachment of European powers, Joseon Korea was forced to sign unequal treaties with foreign powers. After the assassination of Empress Myeongseong in 1895, the Donghak Peasant Revolution, and the Gabo Reforms of 1894 to 1896, the Korean Empire (1897–1910) came into existence, heralding a brief but rapid period of social reform and modernization. However, in 1905, the Korean Empire signed a protectorate treaty and in 1910, Japan annexed the Korean Empire.