Monterey (Spanish: Monterrey; Ohlone: 'Aacistak') 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 to 1821) and Mexico (1822 to 1836). 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.