Monterey (; ) is a city located in Monterey County on the southern edge of Monterey Bay on the U.S. state of California's Central Coast. Founded on June 3, 1770, it functioned as the capital of Alta California under both Spain (1804–1821) and Mexico (1822–1846). During this period, Monterey hosted California's first theater, public building, public library, publicly funded school, printing-press, and newspaper. It was originally the only port of entry for all taxable goods in California. In 1846, during the Mexican–American War of 1846–1848, the United States Flag was raised over the Customs House. After Mexico ceded California to the U.S. at the end of the war, Monterey hosted California's first constitutional convention in 1849. The city occupies a land area of and the city hall is at above sea level. The 2020 census recorded a population of 30,218. Monterey and the surrounding area have attracted artists since the late 19th-century, and many celebrated painters and writers have lived in the area. Until the 1950s there was an abundant fishery. Monterey's present-day attractions include the Monterey Bay Aquarium, Cannery Row, Fisherman's Wharf, California Roots Music and Arts Festival, and the annual Monterey Jazz Festival. History Ohlone period Long before the arrival of Spanish explorers, the Rumsen Ohlone tribe, one of seven linguistically distinct Ohlone groups in California, inhabited the area now known as Monterey. They subsisted by hunting, fishing and gathering food on and around the biologically rich Monterey Peninsula. Researchers have found a number of shell middens in the area and, based on the archaeological evidence, concluded the Ohlone's primary marine food consisted at various times of mussels and abalone. A number of midden sites have been located along about of rocky coast on the Monterey Peninsula from the current site of Fishermans' Wharf in Monterey to Carmel. Spanish period The city is named after Monterey Bay. The current bay's name was given by Sebastián Vizcaíno in 1602. He anchored in what is now the Monterey harbor on December 16, and named it Puerto de Monterrey, in honor of the Conde de Monterrey, who was then the viceroy of New Spain. Monterrey is an alternate spelling of Monterrei, a municipality in the Galicia region of Spain from which the viceroy and his father (the Fourth Count of Monterrei) originated. Some variants of the city's name are recorded as Monte Rey and Monterey. Monterey Bay had been described earlier