The California Republic, also known as the Bear Flag Republic, was an unrecognized breakaway state from Mexico that lasted for 25 days in June-July 1846. Beginning with the capture of Sonoma on June 14, 1846, American settlers raised the Bear Flag and declared California independent. The revolt ended on July 9 when U.S. forces raised the American flag as part of the Mexican-American War.