The facilities called jinya (regional government office) in the Edo period and forts and gun batteries built in various parts of Japan as a countermeasure against foreign ships were also kinds of castles.
ところで、江戸時代に存在した陣屋と呼ばれる施設や、幕末に外国船への対策として日本各地に築かれた台場や砲台も城の一種である。