who did the united states defeat in a late-nineteenth century war