Mexico gained its independence from Spain in 1821. With the secularization of the missions by the Mexican government in June 1836, their lands were granted as rewards for loyal service or in response to petitions by individuals. Most of the arable land was divided up into large ranchos by 1846. This opened up the Oxnard Plain to further settlement by Europeans. Control of the area was transferred to the United States under the Treaty of Guadalupe Hidalgo in 1848 and California became the 31st state in the Union in 1850. Many Mexican residents and residents who had immigrated from European countries became U.S. citizens.