Final answer:
Texas gained its independence from Mexico through the Texas Revolution and declared itself as the independent Republic of Texas.
Step-by-step explanation:
The Republic of Texas, also known as the Lone Star Republic, gained its independence from Mexico through the Texas Revolution.
The revolution was sparked by tensions between American settlers and the Mexican government over issues like cultural, religious, and economic differences.
The Texan forces led by figures like Sam Houston fought for independence and eventually declared Texas as an independent nation in 1836. Texas remained independent until it was annexed by the United States in 1845, which eventually led to the Mexican-American War.