The castle was built between 1666 and 1679 by the Dutch East India Company. It served as a stop-over for ships sailing the Spice Route. The castle forms a pentagonal shape, and the five bastions of the star are the Leerdam to the west, and clockwise from it the Buuren, Katzenellenbogen, Nassau and Oranje. The original fortress was geared with cells which were used during the Second Boer War from 1899-1902, when part of the castle was also used as a prison. Apart from the military function, it has also had luxurious living quarters, shops, workshops and even a small church and bakery. The Castle of Good Hope was declared a national monument in 1936 and is considered the oldest colonial building in South Africa.