A medieval castle refers to a large, fortified building that was built during the Middle Ages (around the 5th to 15th centuries). It was designed to protect the people inside and to serve as a stronghold against enemies. Castles often had high walls, towers, and a moat filled with water for defense. They were used by kings, nobles, and knights for living, governing, and defense purposes. Some castles still exist today and are popular tourist attractions.