It became its own country, called the Republic of Texas, from 1836 until it agreed to join the United States in 1845. Sixteen years later, it seceded along with 10 other states to form the Confederacy. The Civil War forced it back into the Union, where it has stayed ever since.