A keep is a type of fortified tower built within castles during the Middle Ages by European nobility. Scholars have debated the scope of the word keep, but usually consider it to refer to large towers in castles that were fortified residences, used as a refuge of last resort should the rest of the castle fall to an adversary. The first keeps were made of timber and formed a key part of the motte-and-bailey castles that emerged in Normandy and Anjou during the 10th century; the design spread to England, Portugal, south Italy and Sicily.
https://en.wikipedia.org/wiki/Keep