Texas was a part of Mexico when the colony of Spain obtained independence as a result of the Mexican War of Independence, 1810-1821. There followed a brief empire under Agustín de Iturbide followed by the first Mexican Republic in 1824 with Guadalupe Victoria (an assumed name) as President. The election to succeed Guadalupe Victoria was one by the founder of the Partido Moderador (Moderate Party), Manuel Gómez Pedraza, however, before he could take office, the now infamous Antonio López de Santa Anna forced him out and annulled the election. Antonio López de Santa Anna installed the first arguably African-American president of a major North American country, Vicente Guerrero, into power. One of Vicente Guerrero’s most important acts of his brief (1 April 1829 – 17 December 1829) term in power was to ban slavery and emancipate all slaves. The Presidency of Vicente Guerrero ended when his Vice President, Anastasio Bustamante lead a coup against him (and had him executed). More unrest followed, but many must have thought that Mexico was slowly becoming a democracy.
Liberal changes may be good (especially applied to conditions of the early 19th century), but Valentín Gómez Farías changed things too much and too fast for the Catholic and military parts of Mexico which revolted against him. The resulting conflict saw Antonio López de Santa Anna in power as President with the followers of Valentín Gómez Farías forced to hide or leave (mostly to the United States). Enough with democracy; Antonio López de Santa Anna reformed Mexico into a Catholic dictatorship in 1836 and tore up the Constitution of 1824. The new Constitution of 1835 eliminated the loose confederation of states and created a powerful federal government.