Barnstable ( ) is a city, sometimes called the Town of Barnstable, in the U.S. state of Massachusetts and the county seat of Barnstable County. Barnstable is the largest community on Cape Cod. At the 2010 census it had a population of 45,193.