When Did Texas Join the United States?

Texas initially joined the Union in 1845 and many believe that is what initially started the Mexican-American war. It was during that time that Texas seceded from the Union and then rejoined after the Civil War was over.