Ayer () is a town in Middlesex County, Massachusetts, United States. Originally part of Groton, it was incorporated February 14, 1871, and became a major commercial railroad junction. The town was home to Camp Stevens, a training camp for Massachusetts volunteers during the American Civil War. Later, Fort Devens was established by the federal government to train New England soldiers for World War I. Fort Devens is a major influence on the area, although it is considerably smaller than when it was first closed in the mid-1990s. The town's population was 7,427 at the 2010 census.
For geographic and demographic information on specific parts of the town of Ayer, please see the articles on Ayer (CDP) and Devens, Massachusetts.
Ayer was originally inhabited by the Nashaway, a Nipmuc people that inhabited the lands along the Nashua River and its tributaries. A small settlement was located along the banks of the Nonacoicus Brook, located in the western part of the town. The name of the Nashaway village, its people and the brook, pronounced by locals as /ˈnɒ nə ˌkɔɪ ʃəs/, was also recorded in early English sources as 'Nonajcoyjicus,' 'Nonocoyecos,' 'Nonacoiacus' and 'Nonaicoics.' According to the personal manuscripts of Justice Samuel Sewall, best known for his controversial role in the Salem witch trials, he was told sometime in 1698 by Hanah, wife of Sachem Ahaton of the Ponkapoag Massachusett tribe, that the name was actually Nunnacoquis (modern Wôpanâak Massachusett dialect Nunahkuqees /nənahkəkʷiːs/) and signified 'an Indian earthen pot' although literally refers to a 'small dry earthen pot.' The name was likely a reference to a series of small mounds along the banks of the Nonacoicus Brook.
Very little archaeological evidence has been found of settlement in the region, most likely lost to centuries of cultivation and development, although a handful of stone tools or evidence of habitation have been found along the shores of the Nashua River, Nonacoicus Brook, Sandy Pond and Long Pond as well as a rock shelter on Snake Hill. Although some have been dated to the Early Woodland Period (3000-2000 BP), the majority of findings are from the Late Woodland and Early Contact Period (1000-450 BP). In addition, portions of Main Street and Sandy Pond Road are believed to follow the vast network of trails used by Native peoples for trade, travel and communication.