In 1895, the Qing lost the First Sino-Japanese War and gave away the territory of Taiwan to Japan. The Japanese began to use the fort as an army hospital. In 1944, the Japanese began to restore the buildings including the walls that the Dutch had built, the Hai-Shen Temple, the Wunchang Pavilion and the Penghu Academy.