The war between the United States and Mexico was decades in the making. Although Texas was an independent republic from 1836 to 1845, Texans retained an affiliation with the United States that virtually assured annexation at some point. Mexico’s reluctance to give up Texas put it on a collision course with the United States.