<P> The California Republic was short lived; the same year marked the outbreak of the Mexican--American War (1846--48). When Commodore John D. Sloat of the United States Navy sailed into Monterey Bay and began the military occupation of California by the United States, Northern California capitulated in less than a month to the United States forces . After a series of defensive battles in Southern California, the Treaty of Cahuenga was signed by the Californios on January 13, 1847, securing American control in California . </P> <P> Following the Treaty of Guadalupe Hidalgo (February 2, 1848) that ended the war, the westernmost portion of the old Mexican territory of Alta California soon became the American state of California, and the remainder of the old territory was then subdivided into the new American Territories of Arizona, Nevada, Colorado and Utah . The lightly populated and arid lower region of old Baja California remained as a part of Mexico . In 1846, the total settler population of the western part of the old Alta California had been estimated to be no more than 8,000, plus about 100,000 Native Americans, down from about 300,000 before Hispanic settlement in 1769 . </P> <P> In 1848, only one week before the official American annexation of the area, gold was discovered in California, this being an event which was to forever alter both the state's demographics and its finances . Soon afterward, a massive influx of immigration into the area resulted, as prospectors and miners arrived by the thousands . The population burgeoned with United States citizens, Europeans, Chinese and other immigrants during the great California Gold Rush . By the time of California's application to the US Congress for statehood in 1850, the settler population of California had multiplied to 100,000 . By 1854 over 300,000 settlers had come . Between 1847 and 1870, the population of San Francisco increased from 500 to 150,000 . California was suddenly no longer a sparsely populated backwater, but seemingly overnight it had grown into a major US population center . </P> <P> The seat of government for California under Spanish and later Mexican rule had been located in Monterey from 1777 until 1845 . Pio Pico, last Mexican governor of Alta California, had briefly moved the capital to Los Angeles in 1845 . The United States consulate had also been located in Monterey, under consul Thomas O. Larkin . </P>

What was the population of california when it became a state
find me the text answering this question