John Drake Sloat, a veteran of the War of 1812, was commander of the U.S. Pacific fleet in 1846. He sailed to California after receiving word of the declaration of war against Mexico, fearing that the British might seize the sparsely populated province. On July 7, Sloat raised the stars and stripes at Monterey, effectively closing the short history of the Bear Flag Republic. He later gained control of Yerba Buena (later San Francisco) and Sonoma, but was forced to retire on account of illness. He was replaced by Robert Field Stockton, who had seen service in the War of 1812 and the Tripolitan War. Like New Mexico earlier, the non-American population soon rose in opposition to the new regime. Spanish-speaking residents, the californios, had never been particularly loyal to Mexico, but were even less enthusiastic about a new American-backed government. By October, U.S. forces were pushed out of Los Angeles and fighting continued on several other fronts. In December, Stephen Kearny and his small force arrived in southern California. They were exhausted from their journey from New Mexico and sustained heavy losses at the hands of the californios in a battle at San Pascual. The timely appearance of Stockton and his forces from San Diego saved Kearny’s army from complete defeat. In January 1847, a coordinated attack was staged against Los Angeles with Kearny arriving by land and Stockton by sea. Frémont also was expected, but his arrival was delayed. Preliminary battles were fought at Rio San Gabriel and La Mesa on January 8 and 9; Los Angeles fell to U.S. forces on January 10. Frémont arrived and conducted mop-up operations against the californios, and on January 13 represented the United States in signing the Treaty of Cahuenga, which brought an end to the fighting in California. The war in California was over, but tension quickly developed among the leaders. Stockton and Frémont eventually joined in opposition to Kearny's rule. This embarrassing situation was alleviated by the arrival of a new military governor.