The only consolidated city-county in California, San Francisco encompasses a land area of about on the northern end of the San Francisco Peninsula, giving it a density of about 17,620 people per square mile (6,803 people per km2). It is the most densely settled large city (population greater than 200,000) in the state of California and the second-most densely populated major city in the United States after New York City. San Francisco is the fourth most populous city in California, after Los Angeles, San Diego and San Jose, and the 14th most populous city in the United States—with a Census-estimated 2012 population of 825,863. The city is also the financial and cultural hub of the larger San Jose-San Francisco-Oakland combined statistical area, with a population of 8.4 million.
San Francisco (Spanish for "Saint Francis") was founded on June 29, 1776, when colonists from Spain established a fort at the Golden Gate and a mission named for St. Francis of Assisi a few miles away. The California Gold Rush of 1849 brought rapid growth, making it the largest city on the West Coast at the time. Due to the growth of its population, San Francisco became a consolidated city-county in 1856. After three-quarters of the city was destroyed by the 1906 earthquake and fire, San Francisco was quickly rebuilt, hosting the Panama-Pacific International Exposition nine years later. During World War II, San Francisco was the port of embarkation for service members shipping out to the Pacific Theater. After the war, the confluence of returning servicemen, massive immigration, liberalizing attitudes, and other factors led to the Summer of Love and the gay rights movement, cementing San Francisco as a center of liberal activism in the United States.
Today, San Francisco is ranked 44th of the top tourist destinations in the world, and was the sixth most visited one in the United States in 2011. The city is renowned for its cool summers, fog, steep rolling hills, eclectic mix of architecture, and landmarks including the Golden Gate Bridge, cable cars, the former prison on Alcatraz Island, and its Chinatown district. It is also a primary banking and finance center.
The earliest archaeological evidence of human habitation of the territory of the city of San Francisco dates to 3000 BC. The Yelamu group of the Ohlone people resided in a few small villages when an overland Spanish exploration party, led by Don Gaspar de Portolà arrived on November 2, 1769, the first documented European visit to San Francisco Bay. Seven years later, on March 28, 1776, the Spanish established the Presidio of San Francisco, followed by a mission, Mission San Francisco de Asís (Mission Dolores), established by the Novo-Spanish explorer Juan Bautista de Anza.
Upon independence from Spain in 1821, the area became part of Mexico. Under Mexican rule, the mission system gradually ended, and its lands became privatized. In 1835, Englishman William Richardson erected the first independent homestead, near a boat anchorage around what is today Portsmouth Square. Together with Alcalde Francisco de Haro, he laid out a street plan for the expanded settlement, and the town, named Yerba Buena, began to attract American settlers. Commodore John D. Sloat claimed California for the United States on July 7, 1846, during the Mexican-American War, and Captain John B. Montgomery arrived to claim Yerba Buena two days later. Yerba Buena was renamed San Francisco on January 30 of the next year, and Mexico officially ceded the territory to the United States at the end of the war. Despite its attractive location as a port and naval base, San Francisco was still a small settlement with inhospitable geography.
The California Gold Rush brought a flood of treasure seekers. With their sourdough bread in tow, prospectors accumulated in San Francisco over rival Benicia, raising the population from 1,000 in 1848 to 25,000 by December 1849. The promise of fabulous riches was so strong that crews on arriving vessels deserted and rushed off to the gold fields, leaving behind a forest of masts in San Francisco harbor. California was quickly granted statehood, and the U.S. military built Fort Point at the Golden Gate and a fort on Alcatraz Island to secure the San Francisco Bay. Silver discoveries, including the Comstock Lode in 1859, further drove rapid population growth. With hordes of fortune seekers streaming through the city, lawlessness was common, and the Barbary Coast section of town gained notoriety as a haven for criminals, prostitution, and gambling.
Entrepreneurs sought to capitalize on the wealth generated by the Gold Rush. Early winners were the banking industry, with the founding of Wells Fargo in 1852 and the Bank of California in 1864. Development of the Port of San Francisco and the establishment in 1869 of overland access to the Eastern U.S. rail system via the newly completed Pacific Railroad (the construction of which the city only reluctantly helped support) helped make the Bay Area a center for trade. Catering to the needs and tastes of the growing population, Levi Strauss opened a dry goods business and Domingo Ghirardelli began manufacturing chocolate. Immigrant laborers made the city a polyglot culture, with Chinese railroad workers creating the city's Chinatown quarter. In 1870, Asians made up 8% of the population. The first cable cars carried San Franciscans up Clay Street in 1873. The city's sea of Victorian houses began to take shape, and civic leaders campaigned for a spacious public park, resulting in plans for Golden Gate Park. San Franciscans built schools, churches, theaters, and all the hallmarks of civic life. The Presidio developed into the most important American military installation on the Pacific coast. By 1890, San Francisco's population approached 300,000, making it the eighth largest city in the U.S. at the time. Around 1901, San Francisco was a major city known for its flamboyant style, stately hotels, ostentatious mansions on Nob Hill, and a thriving arts scene. The first North American plague epidemic was the San Francisco plague of 1900–1904.
Rebuilding was rapid and performed on a grand scale. Rejecting calls to completely remake the street grid, San Franciscans opted for speed. Amadeo Giannini's Bank of Italy, later to become Bank of America, provided loans for many of those whose livelihoods had been devastated. The influential San Francisco Planning and Urban Research Association or SPUR was founded in 1910 to address the quality of housing after the earthquake. The earthquake hastened development of western neighborhoods that survived the fire, including Pacific Heights, where many of the city's wealthy rebuilt their homes. In turn, the destroyed mansions of Nob Hill became grand hotels. City Hall rose again in splendorous Beaux Arts style, and the city celebrated its rebirth at the Panama-Pacific International Exposition in 1915.
It was during this period San Francisco built some of its most important infrastructure. Civil Engineer Michael O'Shaughnessy was hired by San Francisco Mayor James Rolph as chief engineer for the city in September 1912 to supervise the construction of the Twin Peaks Reservoir, the Stockton Street Tunnel, the Twin Peaks Tunnel, the San Francisco Municipal Railway, the Auxiliary Water Supply System, and new sewers. San Francisco's streetcar system, of which the J, K, L, M, and N lines survive today, was pushed to completion by O'Shaughnessy between 1915 and 1927. It was the O'Shaughnessy Dam, Hetch Hetchy Reservoir, and Hetch Hetchy Aqueduct that would have the largest effect on San Francisco. An abundant water supply enabled San Francisco to develop into the city it has become today.
During World War II, the Hunters Point Naval Shipyard became a hub of activity, and Fort Mason became the primary port of embarkation for service members shipping out to the Pacific Theater of Operations. The explosion of jobs drew many people, especially African Americans from the South, to the area. After the end of the war, many military personnel returning from service abroad and civilians who had originally come to work decided to stay. The UN Charter creating the UN was drafted and signed in San Francisco in 1945 and, in 1951, the Treaty of San Francisco officially ended the war with Japan.
Urban planning projects in the 1950s and 1960s involved widespread destruction and redevelopment of west-side neighborhoods and the construction of new freeways, of which only a series of short segments were built before being halted by citizen-led opposition. The onset of containerization made San Francisco's small piers obsolete, and cargo activity moved to the larger Port of Oakland. The city began to lose industrial jobs and turned to tourism as the most important segment of its economy. The suburbs experienced rapid growth, and San Francisco underwent significant demographic change, as large segments of the white population left the city, supplanted by an increasing wave of immigration from Asia and Latin America. From 1950 to 1980, the city lost over 10 percent of its population.
Over this period, San Francisco became a magnet for America's counterculture. Beat Generation writers fueled the San Francisco Renaissance and centered on the North Beach neighborhood in the 1950s. Hippies flocked to Haight-Ashbury in the 1960s, reaching a peak with the 1967 Summer of Love. In 1974, the Zebra murders left at least 16 people dead. In the 1970s, the city became a center of the gay rights movement, with the emergence of The Castro as an urban gay village, the election of Harvey Milk to the Board of Supervisors, and his assassination, along with that of Mayor George Moscone, in 1978.
Bank of America completed 555 California Street in 1969 and the Transamerica Pyramid was completed in 1972, igniting a wave of "Manhattanization" that lasted until the late 1980s, a period of extensive high-rise development downtown. The 1980s also saw a dramatic increase in the number of homeless people in the city, an issue that remains today, despite many attempts to address it. The 1989 Loma Prieta earthquake caused destruction and loss of life throughout the Bay Area. In San Francisco, the quake severely damaged structures in the Marina and South of Market districts and precipitated the demolition of the damaged Embarcadero Freeway and much of the damaged Central Freeway, allowing the city to reclaim its historic downtown waterfront and revitalizing the Hayes Valley neighborhood.
During the dot-com boom of the late 1990s, startup companies invigorated the economy. Large numbers of entrepreneurs and computer application developers moved into the city, followed by marketing, design, and sales professionals, changing the social landscape as once-poorer neighborhoods became increasingly gentrified. Demand for new housing and office space ignited a second wave of high-rise development, this time South of Market. By 2000, the city's population reached new highs, surpassing the previous record set in 1950. When the bubble burst in 2001, many of these companies folded and their employees were laid off. Yet high technology and entrepreneurship remain mainstays of the San Francisco economy with the social media boom fueling growth in the second decade of the new century.
Note: The 1850 total is incomplete; the returns for Contra Costa and Santa Clara Counties were lost before reaching Washington; those for San Francisco County were destroyed by fire. The State census of 1852 showed a population of 2,786 for Contra Costa, 36,154 for San Francisco, and 6,764 for Santa Clara; the 1852 State total was 215,122, excluding El Dorado County, whose population was not enumerated but was estimated at 40,000.