(KRON) — Sacramento has been the capital city of California for nearly 200 years, but several other cities held the title before that — including some in the Bay Area.

According to the California State Library, California’s first capital was Monterey. It served as the capital from 1774-1849, before California was a U.S. state.

“Although Monterey was never a capital of the State of California, it served as the political and religious capital of Mexican California from 1781 to 1846, and remained the political center of California during the military occupation. In 1846, the first U.S. flag raised in California was in Monterey,” the state library’s website said.

California became a state in 1850, and its first capital was San Jose. According to the library, the Capitol was located near where the San Jose Fairmont Hotel once stood, at 170 South Market St.

San Jose served as the capital from 1849-1851 before another Bay Area city took over — Vallejo.

Vallejo’s tenure as California’s capital was short-lived. It held the position from Jan. 5, 1852, to Jan. 16 of that year, when it was moved to Sacramento for legislative session.

It returned to Vallejo after the session, residing on the 300 block of York St. Early in 1853, it moved a short distance east to Benicia, according to the state library.

Benicia’s Capitol building still stands at 115 West G St., making it the only surviving Capitol outside of Sacramento, according to the California Department of Park and Recreation. Benicia was the capital city from Jan. 1853 to Feb. 1854, when it shifted to Sacramento.

Sacramento has been the capital city since then, save for a quick stop in San Francisco. The library says heavy rains in 1861 and 1862 flooded the Sacramento River, inundating the city. As a result, legislature temporarily moved to the Merchants’s Exchange Building in the City by the Bay.