Texas became the 28th state in the United States in 1845. Texas has been controlled by Spain, France, the Confederate States of America, and Mexico. It declared its independence from Mexico in 1836. It was its own country, the Republic of Texas, for 9 years (1836–1845). It is called the "Lone Star State" and its flag has one star.