The Qing Dynasty was defeated in the First Sino-Japanese War and signed the Treaty of Shimonoseki, ceding Taiwan. In May 1895, Prince Tokugawa Yoshiyuki arrived in Taiwan to take over. In the same month, Qiu Fengjia established the Republic of Taiwan to resist Japanese rule. Wu Tangxing, a scholar from Miaoli, was entrusted by Qiu Fengjia to organize the militia. Wu Tangxing was kind-hearted and well-respected, while his wife Huang Xian was knowledgeable and principled. At that time, local heroes such as Xu Xiang and Jiang Shaozu from Hsinchu rallied under his banner, and the militia united to drive the Japanese out of Taiwan. The militia utilized their knowledge of the terrain to engage in guerrilla warfare against the Japanese army, partially compensating for their lack of weaponry. Meanwhile, the bandit Lin Tianba, who was unwilling to be ruled by foreigners, also joined the militia with his own group. On June 24, the Japanese army launched an attack on Taoyuan and Hsinchu, making the situation for the militia increasingly difficult. However, the resolute resistance from Wu Tangxing and others inspired more Taiwanese people to join the fight.