Sonoma Barracks was built in the late 1830s and early 1840s as part of Mexico’s effort to strengthen its northern frontier, serving under Mariano Guadalupe Vallejo as a barracks, headquarters, and military storehouse in Sonoma. Vallejo directed regional operations from there until inadequate government support led him to disband the company in 1844. In June 1846, American insurgents seized Vallejo, captured the barracks and its supplies without a shot, and made it headquarters of the short-lived California Republic, where the Bear Flag was created. Afterward it served U.S. forces, later took on civilian uses, and was eventually restored as a major Sonoma landmark.