The Legislature (Diputación) declared independence from Mexico in the Revolution of 1836. In 1838, Gov. Alvarado was able to use that to federate California with Mexico, which was forced to recognize California as a "free and sovereign state" of its own. The last governor appointed by Mexico, Manuel Micheltorena, was thrown out of California in 1845, and replaced with native son Pío Pico in free elections. Isaac Graham, whose Tennessean troops secured Californian liberty, returned to a hero's welcome. By 1846, California would be permanently independent from Mexico. Further reading:)