The campaign effectively ended on 21 October 1895, with the flight of Liu Yongfu, the second Republican president, and the surrender of the Republican capital Tainan.