They took it from Mexico in 1848.
more precisely, Mexico, Santa Ana to be specific, lost it in a war in which combined American arms under the Generalship of Winfield Scott captured Mexico City and the US Marines victoriously visited the Halls of Montezuma