in the late nineteenth and early 20th centuries, the u.s. started being more active in foreign affairs. in 1898, the united states fought a war with spain called the spanish–american war. the united states won, and gained puerto rico, guam, guantanamo and the philippines. combined with the purchase of alaska and the taking-over of hawaii, the united states had gained all the territory it has today, plus some it would later lose after world war ii. around this time, the u.s. and european nations opened up trade with china. this was because they had beaten china in the opium wars and the boxer rebellion. the u.s. and europe were able to trade with china through the open door policy.