Overview
Texas was annexed by the United States in 1845 and became the 28th state.

Until 1836, Texas had been part of Mexico, but in that year a group of settlers from the United States who lived in Mexican Texas declared independence.

They called their new country the Republic of Texas, which was an independent country for nine years.

https://www.khanacademy.org/humanities/us-history/the-early-republic/age-of-jackson/a/annexing-texas