The majority of large-scale enclosure walls constructed in Egypt in the second millennium bc were built around temples rather than towns. These walls were high and massive, sometimes with multiple enceintes, while details such as buttresses and crenellations appear to have related the design to contemporary defensive architecture. A libation basin from Memphis demonstrates clearly that a temple could be viewed as equivalent to a fortress by local inhabitants while the mortuary temple of Ramesses III at Medinet Habu was closely modelled on contemporary fortress construction. These enclosure walls often represent a very significant investment of resources but are difficult to explain as defensive. Unlike town walls, temple enclosures were not optional extras but were an essential part of the architecture of the shrine.