Texas was formerly part of New Spain, and then the newly independent Mexico. When in 1835 the Mexican President abolished the Constitution, several states revolted. Texas joined them in October 1835, at first demanding the reinstatement of the Constitution. By the following year, the objective had changed, and on 2 March 1836 – with the siege of the Alamo still in progress – the Republic of Texas declared independence.
The next few years were dogged by war with Native American Comanches, and then by invasions by Mexico, which refused to accept the state's independence. Texan politicians were divided as to whether they wished to remain independent or join the United States. In 1845, the US Congress authorised the annexation of Texas, and it became a US state on 29 December 1845. This led to the Mexican-American War of 1846-48, which ended in victory for the United States and further territorial gains, including California.