Mexico abolished slavery in 1829. The people in what would later be called Texas would fight the Battle of the Alamo in 1836 and later, in 1845 join the United States to keep slavery alive.
Just 15 years later, in 1861 Texas would join the Confederacy in yet another bid to maintain slavery. This would only last until the end of the Civil War in 1864 when slavery was abolished in the United States. In the years before and during the US Civil War, many slaves escaped to freedom in Mexico. A good article from National Endowment of the Humanities.
