Although Santa Anna was defeated at the Battle of San Jacinto and signed the Treaties of Velasco in 1836, his forces continued to invade the Republic of Texas hoping to regain control.
In 1842, a force of 700 men under the command of Alexander Somervell left San Antonio to punish the Mexican Army for raids in Texas. The Somervell Expedition defeated the Mexicans at Laredo and then took the Mexican town of Guerrero. Somervell ordered his men to disband and return home.
About 300 of the men ignored the order and continued on to the town of Ciudad Mier, they became known as the Mier Expedition. The Texans were unaware that a force of 3,000 Mexican troops lay in wait. Although they inflicted heavy casualties on the Mexicans, about 200 of the Texans were forced to surrender.
The prisoners were marched to Matamoros and then toward Mexico City for punishment. About 180 of them escaped during the trip but almost all were eventually recaptured. Santa Anna ordered that the recaptured prisoners be put to death. Diplomatic efforts by the foreign ministers of the United States and Great Britain led Santa Anna to compromise that only one in ten would die.
What happened next became known as the "Black Bean Episode". The prisoners were forced to draw from a jar containing 159 white beans and 17 black beans. Those unlucky enough to draw a black bean were executed by firing squad. The survivors were sent to various prisons in Mexico. Some escaped and many died in prison of wounds, disease, and starvation. In September of 1844, Santa Anna ordered that the remaining prisoners be released.