What country was a territory of the united states?