Perched atop hills and filled-in marshland at the entrance to one of the Pacific’s largest natural harbors, San Francisco has had an outsized influence on the history of California and the United States. Originally a Spanish (later Mexican) mission and pueblo, it was conquered by the United States in 1846 and by an invading army of prospectors following the 1848 discovery of gold in its hinterland. The Gold Rush made San Francisco a cosmopolitan metropolis with a frontier edge. The great 1906 earthquake and fire destroyed much of the city but barely slowed its momentum; San Francisco barreled through the 20th century as a center of wealth, military power, progressive culture and high technology.

San Francisco: Prehistory and Founding

The first inhabitants of the San Francisco area arrived around 3000 B.C. By the 16th century, when the first Europeans sailed along the California coast (always missing the Golden Gate due to fog), the area was inhabited by the Ohlone-speaking Yelamu tribe. The first westerners to see the bay were members of the 1769 Portola expedition. Seven years later, Juan Bautiza de Anza marched north from San Diego with a settlement party to establish a Spanish presidio and mission. By 1808 Mission San Francisco de Asis was the center of spiritual and material life for more than 1,000 neophytes drawn from local tribes.

Did you know? In 1849 San Francisco's harbor was filled with abandoned ships, whose crews had deserted to head for the gold fields. Many of the vessels were used as raw materials for the city's harborside expansion.

San Francisco: Mexican Rule, American Takeover

In 1821, Mexico won its independence from Spain, cementing the decline of the mission era. In 1835 an American, William Richardson, became the first permanent resident of Yerba Buena. By the 1840s dozens more Americans came to Alta California and began agitating for independence. After a briefly declared “California Republic,” they welcomed the arrival of James B. Montgomery, a U.S. Navy captain who came ashore on July 9, 1846, to raise the U.S. flag in Yerba Buena’s plaza (today’s Portsmouth Square).

San Francisco: Gold Rush and Rapid Growth

On January 24, 1848, the first gold was found at Sutter’s Fort, in the California foothills. Within months, San Francisco (renamed from Yerba Buena in 1847) became the central port and depot of the frenzied Gold Rush. Over the next year, arriving “forty-niners” increased the city’s population from 1,000 to 25,000

The city was lawless and wild, its Barbary Coast district full of prostitution and gambling. Six major fires broke out between 1849 and 1851. In 1859 the silver boom of Nevada’s Comstock Lode again filled the city’s docks and lined its pockets. Construction of the Central Pacific Railroad—funded by the “Big Four” businessmen Charles Crocker, Mark Hopkins, Collis P. Huntington and Leland Stanford—drew thousands of laborers from China. Although many were later forced to leave by exclusionary U.S. policies, San Francisco’s thriving Chinatown quickly became the largest Chinese settlement outside of Asia.

The city expanded as cable cars enabled the city’s grid to spread over its steepest hills. In 1887 planners carved out 1,000 acres on the Pacific side of the peninsula for Golden Gate Park.

San Francisco: Earthquake, Fire and Recovery

On April 18, 1906, the San Andreas Fault slipped more than 10 feet, unleashing a massive earthquake later estimated at 7.8 on the Richter scale. The tremors broke water mains and triggered fires that raged for four days, killing 3,000 people, destroying 25,000 buildings and leaving 250,000 homeless. The city rebuilt quickly with an improved city center and hosted the lavish Panama International Exposition just nine years later.

The 1930s saw growth both in the city and its outlying communities, and the construction of the iconic Golden Gate and San Francisco Bay Bridges.

San Francisco: World War II and the Cold War

San Francisco was the main point of embarkation for World War II’s Pacific theater, and the region became a major arms production center. After Pearl Harbor, the city’s Japanese residents were forced into internment camps far inland. Their abandoned neighborhood was soon filled by African-Americans arriving from the South to work in the war industries.

The city also played a key role in the transition from World War II to the Cold War, hosting the 1945 conference at which the U.N. Charter was drafted and continuing to draw workers to develop technologies for the nuclear age.

San Francisco: Counterculture

San Francisco has maintained its reputation as a center of cultural bohemianism. In earlier years it had drawn writers from Mark Twain to Jack London, and it became a center for the 1950s beat poets and for the Haight-Ashbury hippie counterculture that peaked with the 1967 “Summer of Love.”

Long a hotbed of environmental, labor and women’s rights activism, the city gained a reputation for welcoming gays and lesbians. Its Castro District was a center of the gay rights movement. In the 1980s the city worked to respond to the challenges of chronic homelessness and the AIDS epidemic.

On October 17, 1989, another large earthquake hit the city, damaging buildings, collapsing freeways and killing 67. A decade later, a boom centered on Internet technology began, drawing entrepreneurs to the city and raising rents, respectability and resentment in its rougher neighborhoods. The crowded city’s population, steady for decades, began to rise again.