During this period, the Mexican government was so involved with affairs closer to home that its influence over California was beginning to slip away. Many Californios-the Mexican population of California-were so dissatisfied with Mexican rule that had they decided to separate from Mexico, she would have been able to do little about it.
Concerned that some foreign power might take control of California, President James K. Polk sent his "confidential agent," Thomas O. Larkin, to make it known to the Californios that they would be received as brethren should they decide to unite with the United States.
Early in 1846, U.S. Army Captain John C. Fremont arrived in California with sixty well-armed men on a "scientific expedition." Fremont began provoking the Mexican authorities and stirring up the American settlers by spreading rumors of impending action against them by the Mexican government.
In June, 1846, the Americans heard that a Mexican military force led by General Jose Castro was on its way up the Sacramento Valley, destroying crops, burning houses and driving off the cattle of American settlers. Although untrue, this rumor, along with the presence of Fremont and his troops, was enough to spur the Americans into action.
On June 14, 1846, a group of thirty Americans marched on Sonoma, which was then the northernmost center of Mexican authority in California. Capturing the town, they took its leading citizen, Mariano Vallejo, prisoner. They then announced the establishment of the California Republic and declared themselves independent of Mexican rule.
Upon determining that they could not count on the support of Fremont, some of the party wanted to abandon the town and retreat. At this crucial moment, Wm. B. Ide stepped forward and made a rousing speech declaring that he would die before retreating in disgrace. The party rallied around Ide, declared him "President" of the new republic, and raised the famous Bear Flag.
On July 9, 1846, after learning that the United States had declared war on Mexico, the settlers lowered the Bear Flag and raised the American flag. California became a protectorate of the United States until its admission as the 31st state on September 9, 1850.