City walls invite functionalist explanations. It is at first sight easy to deduce why they were built. Where contemporary written and pictorial evidence survives, however, the subject begins to take on a cognitive dimension. Did people at the time really perceive them as we are apt to imagine? The subject has been extensively discussed in the context of medieval Europe where contemporary pictures and contemporary accounts can be set against the architectural remains themselves. City walls were built for status and symbolism as much as for protection. The following collective discussion of the subject in the context of Egyptian history, both ancient and medieval, seeks to follow the same approach: to confront the documentation of the changing practice of urban walling with evidence that represents the mindset of the day. For the time of the Pharaohs the subject is complicated — and made more rewarding as a consequence — by the immense effort which the Egyptians also devoted to walled enclosures around prominent religious buildings. Here the temptation for us is to create a separate category from walled settlements, but on a basis that could be quite misleading. Although the dichotomy between the sacred and the profane is apparent in the construction of walls, meanings change and the distinction is far less apparent in the subsequent use of these enclosures. In medieval Egypt the massive walls of Cairo, parts of which are still an impressive sight, also turn out to be a poor guide to how urban defence was generally perceived at that time. As is ever the case in archaeology, the relationship between the minds of the present, the minds of the past and the objects of reflection forms a subtle and complex triangle.