After the US had placed nuclear missiles in Turkey, aimed at Moscow, and the failed US attempt to overthrow the Cuban regime, in May 1962 Nikita Khrushchev proposed the idea of placing Soviet nuclear missiles on Cuba to deter any future invasion attempt. During a meeting between Khrushchev and Fidel Castro that July, a secret agreement was reached and construction of several missile sites began in the late summer.
These preparations were noticed by the Defense Intelligence Agency, which on October 14 tasked an Air Force-operated U-2 aircraft with scanning the suspected areas in Cuba, securing clear photographic evidence of medium-range and intermediate-range ballistic nuclear missiles (MRBMs and IRBMs) on the ground. The United States considered attacking Cuba via air and sea, but decided on a military blockade instead, calling it a "quarantine" for legal and other reasons. The US announced that it would not permit offensive weapons to be delivered to Cuba, while demanding the dismantlement and return of Soviet weapons back to the USSR.
The Kennedy administration held only a slim hope that the Kremlin would agree to their demands, and expected a military confrontation. These fears were underpinned by the October 24, 1962 letter of Soviet Premier Khrushchev to President John F. Kennedy, in which he stated that the US blockade of "navigation in international waters and air space" constituted "an act of aggression propelling human kind into the abyss of a world nuclear-missile war". However, in secret back-channel communications the President and Premier initiated a proposal to resolve the crisis.
While the tense negotiations were taking place, several Soviet ships attempted to run the blockade, increasing tensions to the point that orders were sent out to US Navy ships to fire warning shots and then open fire. On October 27, a U-2 plane was shot down by a Soviet missile crew, an action that could have resulted in immediate retaliation from the Kennedy crisis cabinet, according to Secretary of Defense McNamara's later testimony. Kennedy stayed his hand and the negotiations continued.
The confrontation ended on October 28, 1962, when Kennedy and United Nations Secretary-General U Thant reached an agreement with Khrushchev. Publicly, the Soviets would dismantle their offensive weapons in Cuba and return them to the Soviet Union, subject to United Nations verification, in exchange for a US public declaration and agreement never to invade Cuba. Secretly, the US also agreed that it would dismantle all US-built Jupiter IRBMs, armed with nuclear warheads, which were deployed in Turkey and Italy against the Soviet Union.
After the removal of the missiles and Ilyushin Il-28 light bombers from Cuba, the blockade was formally ended at 6:45 pm EST on November 20, 1962. The tense negotiations between the United States and the Soviet Union pointed out the necessity of a quick, clear and direct communication between Washington and Moscow. As a result, the Moscow-Washington hotline was established.