After their loss at the Battle of Sacramento, the remaining Mexican soldiers retreated south, leaving the city to American occupation.