The Japanese invasion of Taiwan (; ) was a military conflict between the Empire of Japan and the armed forces of the short-lived Republic of Formosa following the Qing Dynasty's cession of Taiwan to Japan in April 1895 at the end of the First Sino-Japanese War. The Japanese sought to take control of their new possession, while the Republican forces fought to resist Japanese occupation. The Japanese landed near Keelung on the northern coast of Taiwan on 29 May 1895, and in a five-month campaign swept southwards to Tainan. Although their advance was slowed by guerrilla activity, the Japanese managed to defeat the forces (a mixture of ex-Qing units and some Hakka and indigenous militias) whenever they attempted to make a stand.