Mexico gained its independence from Spain in 1821 following 11 years of conflict. With independence achieved, Mexico struggled to find its own independent identity, first establishing a monarchy then a constitutional republic. The need to protect the northern frontier prompted the government to establish colonization laws that allowed colonists into Texas. Large groups of people moved to Texas, with the attraction of land and an opportunity to start over. People, such as Stephen F. Austin, helped to facilitate the arrival of immigrants to Texas by ways of colonies and land grants. Many of these colonists, along with the native population, enjoyed a semi-autonomous way of life far from the capital in Mexico.
This autonomy would be challenged with the election of Antonio López de Santa Anna as president in 1833. His political views would change from federalism to centralism causing Mexico to fall into a civil war and Texas to seek its own independence. Laws changed curtailing the influx of immigrants as well as the autonomy that Texans had grown used to. Texas, suffering from a lack of a large population was joined to the neighboring state of Coahuila, forming the state of Coahuila y Texas.