Texas is called the Lone Star State because for almost ten years, from 1836 until its annexation by the United States in 1845, the country was independent.
For three centuries up to 1821, Texas and Mexico had belonged to Spain. In all that time, Spain had shown hardly any interest in this vast territory which is equal in size to the total area of France, Belgium, the Netherlands and Denmark combined. When Mexico gained her independence, Texas was peopled by no more than 7000 and with only three settlements large enough to be called towns. Beset with their own problems of administration and revolts, Mexico allowed American families to colonize land in Texas.
By 1835 there were around 30,000 Americans settled in Texas, outnumbering the Mexicans by four to one. Too late for her own interests, Mexico tried to discipline the American Texans by abolishing slavery, levying duties and establishing military garrisons. Fighting broke out when martial law was declared by the Mexicans who tried to disarm the Texans. On October 2, 1835, the Texans won the first battle of the Texas Revolution at Gonzales. San Antonio was captured in December and the Mexicans withdrew to Mexico.
The Texans were weakened by arguments and lack of unity which allowed the Mexicans to recapture San Antonio on March 2, 1836, but while the Mexicans closed in on the Alamo, Texas declared her independence. The new nation found this independence difficult to manage and was relieved to be annexed in 1845 by a rather unwilling United States of America.