Mexico gained its independence from Spain and from 1821–1846 California was under Mexican rule. The Mexican National Congress passed the Colonization Act of 1824 in which large sections of unoccupied land were granted to individuals and in 1833 the government secularized missions and consequently many civil authorities at the time confiscated the land from the missions for themselves. These two acts aided in the creation of a ranchos system that required a large labor force to maintain. Essentially the entire economy shifted from work on the missions to work on large land estates of wealthy Mexicans. A system was devised where it was virtually cost free to utilize indigenous labor; workers were exchanged between ranchos and essentially became indentured servants.