A castle is a large fortified building or group of buildings. Castles were built to provide protection and security for the people living inside. They were often surrounded by a moat, a deep ditch filled with water. Castles were also used as a place of residence for royalty and nobility. Today, many castles are popular tourist attractions.