Salem is the capital of the U.S. state of Oregon, and the county seat of Marion County. It is located in the center of the Willamette Valley alongside the Willamette River, which runs north through the city. The river forms the boundary between Marion and Polk counties, and the city neighborhood of West Salem is in Polk County. Salem was founded in 1842, became the capital of the Oregon Territory in 1851, and was incorporated in 1857. Salem had a population of 154,637 at the 2010 census, making it the third largest city in the state after Portland and Eugene. Salem is less than an hour driving distance away from Portland.