Ayer, Massachusetts

Ayer, Massachusetts
Main Street
Location in Middlesex County in Massachusetts
Coordinates: 42°33′40″N 71°35′25″W / 42.56111°N 71.59028°W / 42.56111; -71.59028
CountryUnited States
StateMassachusetts
CountyMiddlesex
Settled1668
IncorporatedFebruary 14, 1871
Government
  TypeOpen town meeting
Area
  Total
9.6 sq mi (24.8 km2)
  Land9.0 sq mi (23.4 km2)
  Water0.6 sq mi (1.4 km2)
Elevation
226 ft (69 m)
Population
 (2020)
  Total
8,479
  Density880/sq mi (340/km2)
Time zoneUTC−5 (Eastern)
  Summer (DST)UTC−4 (Eastern)
ZIP Code
01432
Area codes351/978
FIPS code25-03005
GNIS feature ID0618215
Websitewww.ayer.ma.us

Ayer (/ɛər/ AIR) 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 8,479 at the 2020 census.