In 1846, following reports of the annexation of Texas to the United States, American settlers in inland Northern California took up arms, captured the Mexican garrison town of Sonoma, and declared independence there as the California Republic. At the same time, the United States and Mexico had gone to war, and forces of the United States Navy entered into Alta California and took possession of the northern port cities of Monterey and San Francisco. The forces of the California Republic, upon encountering the United States Navy and, from them, learning of the state of war between Mexico and the United States, abandoned their independence and proceeded to assist the United States forces in securing the remainder of Alta California. The California Republic was never recognized by any nation and existed for less than one month, but its flag (the "Bear Flag") survives as the flag of the State of California.