California became a state as a part of the Compromise of 1850. The 1849 request of Californians for statehood led to heated debate in Congress, primarily over the issue of slavery. The compromise allowed admission of the state to the Union, with the requirement that it enter as a free state.
In 1848, the United States and Mexico signed the treaty of Guadalupe Hidalgo, ending a war. At that time, California had 7,500 residents. The Mexican government was likely unaware of what was held within the state or of the population growth it was about to see.
California became a state in a very different way than most states in the westward expansion of the United States. To petition for statehood, it required 60,000 residents. Most states first became territories and then, over time, built the population required for application for statehood. In California, the discovery of gold, just nine days before Mexico signed the treaty, began history's largest gold rush. Rumors of gold nuggets, the size of a man's fist, lying on the ground quickly made their way east, leading to a massive influx of "forty-niners" looking for a fortune. The area met the population requirement by 1849, and because of its need for civil government, petitioned for statehood.