California experienced difficulties establishing civil society after becoming a U.S. territory in 1848. The discovery of gold at Sutter's Mill in 1848 triggered the California Gold Rush, bringing thousands of prospectors from around the world seeking fortune. This massive influx of people transformed California economically and socially, establishing the infrastructure and population centers of San Francisco and Los Angeles.