Kennedy pursued an aggressive foreign policy during the Cold War. This included the failed Bay of Pigs invasion of Cuba in 1961 to overthrow Fidel Castro, and the Cuban Missile Crisis in 1962, bringing the US and USSR to the brink of nuclear war over Soviet missiles in Cuba. Kennedy also had to deal with tensions in Berlin over Soviet control and the construction of the Berlin Wall, as well as competing with the USSR in the Space Race, seeking to land Americans on the moon first.