some Bakufu loyalists made their way north to the city of Hakodate, on Hokkaido. There they set up the Republic of Ezo, centered on a government building within the walls of Goryōkaku, a French-style star fortress, which is nonetheless often included in lists and in literature on Japanese castles. After the fierce Battle of Hakodate, the fortress of Goryōkaku was under siege, and finally surrendered on May 18, 1869, bringing an end to the Boshin War. All castles, along with the feudal domains themselves, were turned over to the Meiji government in the 1871 abolition of the han system. During the Meiji Restoration, these castles were viewed as symbols of the previous ruling elite, and nearly 2,000 castles were dismantled or destroyed. Others were simply abandoned and eventually fell into disrepair. Rebellions continued to break out during the first years of the Meiji period. The last and largest was the Satsuma Rebellion (1877). After heated disagreements in the new Tokyo legislature, young former samurai of the Satsuma domain rashly decided to rebel against the new government, and lobbied Saigō Takamori to lead them. Saigo reluctantly accepted, and led Satsuma forces north from Kagoshima city. Hostilities commenced on February 19, 1877, when the defenders of Kumamoto Castle fired on the Satsuma troops. Fierce hand to hand combat gave way to a siege, but by April 12, reinforcements of the Imperial army arrived to break the siege. After a series of battles, the Satsuma rebels were forced back to Kagoshima city. Fighting continued there, and the stones walls of Kagoshima Castle still show the damage done by bullets. (Kagoshima Castle was never re-built, but portions of the stone walls and the moat were left intact, and later the prefectural history museum was built on the castle's foundation.) The rebel force made their last stand on Shiroyama, or "Castle Mountain", probably named for a castle built there some time in the past, whose name has been lost in history. During the final battle, Saigo was mortally wounded, and the last forty rebels charged the Imperial troops and were cut down by Gatling guns. The Satsuma Rebellion came to an end at the Battle of "Castle Mountain" on the morning of September 25, 1877. Imperial Japanese Army Some castles, especially the larger ones, were used by the Imperial Japanese Army. Osaka Castle served as the headquarters for the 4th Infantry Division, until public funds