In a televised speech of extraordinary gravity, President John F. Kennedy announces on October 22, 1962 that U.S. spy planes have discovered Soviet missile bases in Cuba. These missile sites—under construction but nearing completion—housed medium-range missiles capable of striking a number of major cities in the United States, including Washington, D.C. Kennedy announced that he was ordering a naval “quarantine” of Cuba to prevent Soviet ships from transporting any more offensive weapons to the island and explained that the United States would not tolerate the existence of the missile sites currently in place. The president made it clear that America would not stop short of military action to end what he called a “clandestine, reckless, and provocative threat to world peace.”

What is known as the Cuban Missile Crisis actually began on October 15, 1962—the day that U.S. intelligence personnel analyzing U-2 spy plane data discovered that the Soviets were building medium-range missile sites in Cuba. The next day, President Kennedy secretly convened an emergency meeting of his senior military, political, and diplomatic advisers to discuss the ominous development. The group became known as ExCom, short for Executive Committee. After rejecting a surgical air strike against the missile sites, ExCom decided on a naval quarantine and a demand that the bases be dismantled and missiles removed. On the night of October 22, Kennedy went on national television to announce his decision. During the next six days, the crisis escalated to a breaking point as the world tottered on the brink of nuclear war between the two superpowers.

READ MORE: Key Moments in the Cuban Missile Crisis

On October 23, the quarantine of Cuba began, but Kennedy decided to give Soviet leader Nikita Khrushchev more time to consider the U.S. action by pulling the quarantine line back 500 miles. By October 24, Soviet ships en route to Cuba capable of carrying military cargoes appeared to have slowed down, altered, or reversed their course as they approached the quarantine, with the exception of one ship—the tanker Bucharest. At the request of more than 40 nonaligned nations, U.N. Secretary-General U Thant sent private appeals to Kennedy and Khrushchev, urging that their governments “refrain from any action that may aggravate the situation and bring with it the risk of war.” At the direction of the Joint Chiefs of Staff, U.S. military forces went to DEFCON 2, the highest military alert ever reached in the postwar era, as military commanders prepared for full-scale war with the Soviet Union.

On October 25, the aircraft carrier USS Essex and the destroyer USS Gearing attempted to intercept the Soviet tanker Bucharest as it crossed over the U.S. quarantine of Cuba. The Soviet ship failed to cooperate, but the U.S. Navy restrained itself from forcibly seizing the ship, deeming it unlikely that the tanker was carrying offensive weapons. On October 26, Kennedy learned that work on the missile bases was proceeding without interruption, and ExCom considered authorizing a U.S. invasion of Cuba. The same day, the Soviets transmitted a proposal for ending the crisis: The missile bases would be removed in exchange for a U.S. pledge not to invade Cuba.

The next day, however, Khrushchev upped the ante by publicly calling for the dismantling of U.S. missile bases in Turkey under pressure from Soviet military commanders. While Kennedy and his crisis advisers debated this dangerous turn in negotiations, a U-2 spy plane was shot down over Cuba, and its pilot, Major Rudolf Anderson, was killed. To the dismay of the Pentagon, Kennedy forbid a military retaliation unless any more surveillance planes were fired upon over Cuba. To defuse the worsening crisis, Kennedy and his advisers agreed to dismantle the U.S. missile sites in Turkey but at a later date, in order to prevent the protest of Turkey, a key NATO member.

On October 28, Khrushchev announced his government’s intent to dismantle and remove all offensive Soviet weapons in Cuba. With the airing of the public message on Radio Moscow, the USSR confirmed its willingness to proceed with the solution secretly proposed by the Americans the day before. In the afternoon, Soviet technicians began dismantling the missile sites, and the world stepped back from the brink of nuclear war. The Cuban Missile Crisis was effectively over. In November, Kennedy called off the blockade, and by the end of the year all the offensive missiles had left Cuba. Soon after, the United States quietly removed its missiles from Turkey.

The Cuban Missile Crisis seemed at the time a clear victory for the United States, but Cuba emerged from the episode with a much greater sense of security.The removal of antiquated Jupiter missiles from Turkey had no detrimental effect on U.S. nuclear strategy, but the Cuban Missile Crisis convinced a humiliated USSR to commence a massive nuclear buildup. In the 1970s, the Soviet Union reached nuclear parity with the United States and built intercontinental ballistic missiles capable of striking any city in the United States.

A succession of U.S. administrations honored Kennedy’s pledge not to invade Cuba, and relations with the communist island nation situated just 80 miles from Florida remained a thorn in the side of U.S. foreign policy for more than 50 years. In 2015, officials from both nations announced the formal normalization of relations between the U.S and Cuba, which included the easing of travel restrictions and the opening of embassies and diplomatic missions in both countries.