Hayward ( /ˈheɪwərd/; formerly, Haywards, Haywards Station, and Haywood) is a city located in the East Bay in Alameda County, California. With a population of 144,186, Hayward is the sixth largest city in the San Francisco Bay Area and the third largest in Alameda County. Hayward was ranked as the 37th most populous municipality in California. It is included in the San Francisco-Oakland-Fremont Metropolitan Statistical Area by the US Census. It is located primarily between Castro Valley and Union City, and lies at the eastern terminus of the San Mateo-Hayward Bridge. The city was devastated early in its history by the namesake 1868 Hayward earthquake. From the early 20th century until the beginning of the 1980s, Hayward's economy was dominated by its food canning industry.