Scottish castles are buildings that combine fortifications and residence, built within the borders of modern Scotland. Castles arrived in Scotland with the introduction of
feudalism in the twelfth century. Initially these were wooden
motte-and-bailey constructions, but many were replaced by stone castles with a high curtain wall. During the
Wars of Independence,
Robert the Bruce pursued a policy of castle
slighting. In the late Middle Ages new castles were built, some on a grander scale as "
livery and maintenance" castles that could support a large garrison. Gunpowder weaponry led to the use of gun ports, platforms to mount guns and walls adapted to resist bombardment.