Devens is a regional enterprise zone and census-designated place in the towns of Ayer and Shirley, in Middlesex County and Harvard in Worcester County in the U.S. state of Massachusetts. It is the successor to Fort Devens, a military post that operated from 1917 to 1996. The population was 1,840 at the 2010 census.