Officially, we purchased Texas and New Mexico as part of the peace treaty that ended the Mexican-American War.  We actually gave them much better terms than most victors give the vanquished.  But Mexico was never happy about the loss of their territory, and continued to print maps showing it as belonging to them for centuries.  It would remain a contentious issue until Mexico herself fell to the drug wars of the Twenty-First Century.