Buffalo is a city in the U.S. state of New York. It lies in Western New York at the eastern end of Lake Erie and at the head of the Niagara River on the Canada–United States border. It is the second-most populous city in New York, with a population of 278,349 at the 2020 census. The Buffalo–Niagara Falls metropolitan area, with over 1.16 million residents, is the 51st-largest metropolitan area in the United States. Buffalo is the county seat of Erie County.