The Texas state flag dates from 1839, when it was created as the national flag of the Republic of Texas. It draws its red, white and blue colors from the flag of the United States.
In the 1830s, Texas was struggling to gain its independence from Mexico. In 1836 a group of Texan leaders adopted the Texas Declaration of Independence, creating the Republic of Texas.
The new Republic's political leaders realized they needed a flag. They considered several different designs, but ultimately favored one showing equally-sized red, white and blue rectangles, with a white star superimposed on the blue rectangle. The design was approved in January 1839.
The Republic of Texas lasted less than a decade. It ended when Texas was admitted to the United States in December 1845, but the flag remained as one of the symbols of the new state.