Many of the original timber castles were replaced with stone castles. Over time, stone castles were built in different architectural styles as builders experimented with castle-building techniques. In their infancy, castles were primarily military fortifications used to defend conquered territories from attack.