With the end of the Shogunate and restoration of the Meiji dynasty in 1868, Himeji-jo was taken over by the new government as a military establishment, when part of the west bailey and the samurai houses were dernolished and replaced by military structures.