Although slavery officially existed in Massachusetts until 1788 when a state law was enacted that banned slavery and the slave trade in the Commonwealth, institutional racial segregation was allowed to carry on until the middle of the nineteenth century.
In 1705 the Massachusetts Colonial Legislature enacted a law that “prohibited marriage and fornification” between negroes or mulattoes and whites. In 1786, the prohibition against fornification was eliminated but the ban against intermarriage was now expanded to include Indians. These state laws against inter-racial marriage were enforced until legislative repeal in the 1840’s.
Racial segregation was evident in railroad accommodations in the Commonwealth. On a number of railroad lines in Massachusetts, black citizens were placed either in a separate car by themselves or in railroad cars often neither “decent nor comfortable”. A Massachusetts law prohibiting the practice of racial segregation in mass transportation was finally enacted in 1842.
Public schools in the Massachusetts communities of Salem, Nantucket, and Boston were racially segregated into the 1840’s and 1850’s. All Massachusetts public schools finally became integrated in 1855 with the enactment of a law “prohibiting all distinctions of color and religion in Massachusetts public school admissions.”
For more, see Equality before the law : unconstitutionality of separate colored schools in Massachusetts : argument of Charles Sumner, Esq., before the Supreme Court of Massachusetts, in the case of Sarah C. Roberts vs. the city of Boston, December 4, 1849 (1870)