Buffalo is the county seat of Erie County, and the second most populous city in the U.S. state of New York, after New York City. Originating around 1789 as a small trading community inhabited by the Neutral Nation near the mouth of Buffalo Creek, the city, then a town, grew quickly after the opening of the Erie Canal in 1825, with the city at its western terminus. Its position at the eastern end of Lake Erie strengthened the economy, based on grain milling and steel production along the southern shores and in nearby Lackawanna.