During the Texan War for Independence, the Texas militia under Sam Houston launches a surprise attack against the forces of Mexican General Santa Anna along the San Jacinto River. The Mexicans were thoroughly defeated, and hundreds were taken prisoner, including General Santa Anna himself.
After gaining independence from Spain in the 1820s, Mexico welcomed foreign settlers to sparsely populated Texas, and a large group of Americans led by Stephen F. Austin settled along the Brazos River. The Americans soon outnumbered the resident Mexicans, and by the 1830s attempts by the Mexican government to regulate these semi-autonomous American communities led to rebellion. In March 1836, in the midst of armed conflict with the Mexican government, Texas declared its independence from Mexico.
The Texas volunteers initially suffered defeat against the forces of Santa Anna–Sam Houston’s troops were forced into an eastward retreat, and the Alamo fell. However, in late April, Houston’s army surprised a Mexican force at San Jacinto, and Santa Anna was captured, bringing an end to Mexico’s effort to subdue Texas. In exchange for his freedom, Santa Anna recognized Texas’s independence; although the treaty was later abrogated and tensions built up along the Texas-Mexico border.
The citizens of the so-called Lone Star Republic elected Sam Houston as president and endorsed the entrance of Texas into the United States. However, the likelihood of Texas joining the Union as a slave state delayed any formal action by the U.S. Congress for more than a decade. Finally, in 1845, President John Tyler orchestrated a compromise in which Texas would join the United States as a slave state. On December 29, 1845, Texas entered the United States as the 28th state, broadening the irrepressible differences in the U.S. over the issue of slavery and igniting the Mexican-American War.