The county was created by the General Court of the Massachusetts Bay Colony on May 10, 1643, when it was ordered "that the whole plantation within this jurisdiction be divided into four sheires". Named after the county in England, Essex then comprised the towns of Salem, Lynn, Wenham, Ipswich, Rowley, Newbury, Gloucester, and Andover. In 1680, Haverhill, Amesbury and Salisbury, located north of the Merrimack River, were annexed to Essex County. These communities had been part of Massachusetts' colonial-era Norfolk County. The remaining four towns within colonial Norfolk County, which included Exeter and what is now Portsmouth, were transferred to what became Rockingham County in the Province of New Hampshire. The Massachusetts-based settlements were then subdivided over the centuries to produce Essex County's modern composition of cities and towns.