Called Sawacook, the area was territory of the Pejepscot AbenakiIndians, a subtribe of the Anasagunticooks, who controlled the Androscoggin River. They lived and fished at Pejepscot Falls. But a plague, probably smallpox brought by Europeans, decimated the tribe's population in 1615–1616. On June 16, 1632, the area was granted by the Plymouth Council to Thomas Purchase and George Way, later acquired by Richard Wharton and then, in 1714, by the Pejepscot Company. The first sawmill was built in 1716 on the Cathance River and, in 1717, the plantation received the name Topsham, named for Topsham in Devon, England. On January 31, 1764, it was incorporated as a town by the Massachusetts General Court. Shipbuilding and lumbermills were important early businesses, the latter especially active between 1750–1770. There was a gristmill and brickyard. Pejepscot Falls provided water power to operate mills, and industries included a door, window sash and stairway factory, shingle mill, watch factory, pottery maker, nail factory, pitchfork factory, two tanneries, tobacco manufacturer, two feldsparquarries and a marble works. In 1856, the Sagadahoc Agricultural & Horticultural Society erected its building and fairgrounds, and the town remains host to the annual Topsham Fair. In 1756, a toll bridge connecting Brunswick and Topsham was constructed by the "Proprietors of the Androscoggin Bridge." It was destroyed by fire in 1842. The current Frank J. Woods bridge, known as "the green bridge", was opened in 1932. In 1936, a large flood hit Brunswick and Topsham, damaging the pedestrian "Swing Bridge" and causing the Androscoggin to flow through the lower levels of the Pejepscot Mill. It is thought that Topsham and Brunswick have safe houses related to the Underground Railroad. Although the Underground Railroad was only metaphorically underground, it is thought that in Brunswick and Topsham, it was actually underground, utilizing tunnels which ran between safe houses. These tunnels were constructed of carefully laid red brick with vertical side walls, an arched top and a flat brick-paved bottom up to some 5 feet wide which would allow the easy passage of individuals on foot as well as a horse and buggy if desired. In Topsham, tunnels were constructed from the Granny-Hole Mill on the Androscoggin River up to the Samuel Veazie House, passing through the Charles Thompson House and the Walker Homestead on the way. The Brunswick and Topsham Water District was incorporated in 1903.
As of the census of 2010, there were 8,784 people, 3,720 households, and 2,453 families living in the town. The population density was. There were 4,167 housing units at an average density of. The racial makeup of the town was 96.1% White, 0.8% African American, 0.3% Native American, 1.3% Asian, 0.3% from other races, and 1.2% from two or more races. Hispanic or Latino of any race were 1.6% of the population. There were 3,720 households, of which 28.6% had children under the age of 18 living with them. 52.8% were married couples living together, 9.5% had a female householder with no husband present, 3.6% had a male householder with no wife present, and 34.1% were non-families. 27.0% of all households were made up of individuals. 12.5% had someone living alone who was 65 years of age or older. The average household size was 2.32 persons and the average family size was 2.81 persons. The median age in the town was 45.2 years. 20.6% of residents were under the age of 18; 5.6% were between the ages of 18 and 24; 23.4% were from 25 to 44; 31.6% were from 45 to 64; and 18.8% were 65 years of age or older. The gender makeup of the town was 47.4% male and 52.6% female.
2000 census
As of the census of 2000, there were 9,100 people, 3,424 households, and 2,461 families living in the town. The median income for a household in the town was $47,682, and the median income for a family was $52,134. Males had a median income of $35,943 versus $25,581 for females. The per capita income for the town was $21,135. About 3.0% of families and 4.1% of the population were below the poverty line, including 5.8% of those under age 18 and none of those age 65 or over.