This is a study of ritual, war, and how those frame the construction of communities. Excavations at the fortress of Acaray in the Huaura Valley, Perú yielded evidence for conflict and ritual activities associated with two major time periods: the Early Horizon (ca. 900-200 B.C.) and the Late Intermediate Period (ca. A.D. 1000-1476). Using site survey and excavation data, a geographic information system to perform spatial analysis, and data on regional contexts this study demonstrates that Acaray was simultaneously a place constructed with defense in mind, and a locale for ritual activities linked to the strengthening of social bonds and defensive structures. The Early Horizon occupation was permanent, and Acaray was a fortified settlement with ceremonial structures at its summit. During the Late Intermediate Period, the use of Acaray is ephemeral. Ceremonial trash and offerings made during reconstruction of the fort, and during periodic visits, in the Late Intermediate Period are evidence of practices realized by a community of people living under the threat of war who used Acaray as a refuge. War, or the threat of war, framed the formation of communities during both time periods. In the Late Intermediate Period, a larger community of people converged to rebuild Acaray. This process is concurrent with an elaboration of ritual that I argue helped to maintain community identity. The offerings made during this time are also aimed at healing, coping with fear, ensuring security, strengthening defensive walls, and making explicit links to history - the prior occupation