English colonists sponsored by the Plymouth Company founded a settlement in Maine in 1607 (the Popham Colony at Phippsburg), but it was abandoned the following year. A French trading post was established at present-day Castine in 1613 by Claude de Saint-Étienne de la Tour, and may represent the first permanent European settlement in New England. The Plymouth Colony, established on the shores of Cape Cod Bay in 1620, set up a competing trading post at Penobscot Bay in the 1620s.
The territory between the Merrimack and Kennebec rivers was first called the Province of Maine in a 1622 land patent granted to Sir Ferdinando Gorges and John Mason. The two split the territory along the Piscataqua River in a 1629 pact that resulted in the Province of New Hampshire being formed by Mason in the south and New Somersetshire being created by Gorges to the north, in what is now southwestern Maine. The present Somerset County in Maine preserves this early nomenclature. The territory of Maine was confirmed as part of Massachusetts when the United States was formed, although the final border with British territory was not established until the Webster-Ashburton Treaty of 1842.
Following the Revolution, frontier settlers who resented being ruled from Boston pressed for separation from Massachusetts.
Coastal merchants, who held the balance of political power at the time, resisted the separation movement until the War of 1812 showed that Massachusetts was unable or unwilling to provide adequate protection for the people of the district against British raids.
With popular sentiment unified behind statehood, the separation movement went forward. Congress established Maine as the 23rd state under the Missouri Compromise of 1820. This arrangement allowed Maine to join the Union as a free state, with Missouri entering a year later as a slave state, thereby preserving the numerical balance between free and slave states in the nation.
Source: Wikipedia and Maine Home Connection
New Hampshire on the west, Canada on the north, and the Atlantic Ocean on the east.