The Japanese occupation of Taiwan was strongly resisted by various interests on the island, and was only completed after a full-scale military campaign requiring the commitment of the Imperial Guards Division and most of the 2nd and 4th Provincial Divisions. The campaign began in late May 1895 with a Japanese landing at Keelung, on the northern coast of Taiwan, and ended in October 1895 with the Japanese capture of Tainan, the capital of the self-styled Republic of Formosa. The Japanese defeated regular Chinese and Formosan formations relatively easily but their marching columns were often harassed by guerillas. The Japanese responded with brutal reprisals, and sporadic resistance to their occupation of Taiwan continued until 1902.