The History of TX in a Native Pecan Shell: When the Mexican War of Independence ended in 1821, Texas became part of the new country Mexico. To encourage settlement, Mexican authorities permitted immigration from the United States, and by 1834, it was estimated that over 30,000 Anglos lived in Texas, compared to only 7,800 Mexicans. Partly in response to the Mexican government's transformation to a centralized government from a federalist model, Texian settlers launched the Texas Revolution in October 1835. The Revolution ended in April 1836, when Mexican President Antonio Lopez de Santa Anna was captured after the Battle of San Jacinto. For the next nine years, Texas governed itself as an independent country, the Republic of Texas. In 1845, Texas was annexed to the United States, becoming the 28th state. Long determined to protect slavery, Texas seceded from the United States in 1861 to join the Confederate States of America. Several battles of the American Civil War were fought in Texas, but most Texas regiments served in other parts of the country. When the war ended in 1865, Texas was subject to Reconstruction until the 1870s.