The territory of the Commonwealth of Massachusetts, one of the fifty United States, was settled in the 17th century by several different English colonies. The territories claimed or administered by these colonies encompassed a much larger area than that of the modern state, and at times included areas that are now within the jurisdiction of other New England states or of the Canadian provinces of New Brunswick and Nova Scotia. Some colonial land claims extended all the way to the Pacific Ocean. The first permanent settlement was the Plymouth Colony (1620), and the second major settlement was the Massachusetts Bay Colony at Salem in 1629. Settlements that failed or were merged into other colonies included the failed Popham Colony (1607) on the coast of Maine, and the Wessagusset Colony (1622–23) in Weymouth, Massachusetts, whose remnants were folded into the Plymouth Colony. The Plymouth and Massachusetts Bay colonies coexisted until 1686, each electing its own governor annually. Governance of both colonies was dominated by a relatively small group of magistrates, some of whom governed for many years. The Dominion of New England was established in 1686 which covered the territory of those colonies, as well as that of New Hampshire, Connecticut, and Rhode Island. In 1688, it was further extended to include New York and East and West Jersey. The Dominion was extremely unpopular in the colonies, and it was disbanded when its royally appointed governor Sir Edmund Andros was arrested and sent back to England in the wake of the 1688 Glorious Revolution. After Andros' arrest, each of the colonies reverted to its previous form of governance. King William III, however, reorganized the territory of the Plymouth and Massachusetts Bay colonies into the Province of Massachusetts Bay and appointed Sir William Phips as its royal governor in 1692. The Province of Massachusetts Bay was governed by appointed civilian governors until 1774, when Thomas Hutchinson was replaced by Lieutenant General Thomas Gage amid rising tensions between the Thirteen Colonies and the British Parliament. Gage was the province's last royal governor. He was effectively powerless beyond Boston, and was recalled after the June 1775 Battle of Bunker Hill. By then, the province was already being run de facto by the Massachusetts Provincial Congress; following the adoption of a state constitution in 1779, the newly formed Commonwealth of Massachusetts elected John Hancock as its first governor. Popham Colony: 1607–1608 The Popham Colony was