Rich lords or kings lived in castles in medieval times. This period lasted from the 5th century CE to the end of the 15th century. Many castles were built in Europe and the Middle East during this time. Some were simple and wooden, while others were grand stone palaces.