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. (A brief interregnum occurred in 1855, when Corvallis served as the territorial capital.) It is the second or third largest city in Oregon, often fluctuating with Eugene.