 The origins of the Second Sino-Japanese War can be traced back to the First Sino-Japanese War of 1894–1895, in which China, then under the rule of the Qing dynasty, was defeated by Japan, forced to cede Taiwan to Japan, and recognize the full and complete independence of Korea in the Treaty of Shimonoseki; Japan also annexed the Diaoyudao/Senkaku Islands in early 1895 as a result of its victory at the end of the war (Japan claims the islands were uninhabited in 1895).The Qing dynasty was on the brink of collapse due to internal revolts and foreign imperialism, while Japan had emerged as a great power through its effective measures of modernization.The Republic of China was founded in 1912, following the Xinhai Revolution which overthrew the last imperial dynasty of China, the Qing dynasty (1644–1911).