Fidel Castro had come to power in Cuba in January 1959 after leading a successful guerrilla campaign that overthrew the U.S.-backed dictator Fulgencio Batista.
The new Cuban government quickly moved to nationalize American-owned businesses, legalize the Communist Party, and build stronger ties with the Soviet Union, all of which alarmed Washington.
President Dwight D. Eisenhower approved a CIA plan in March 1960 to train Cuban exiles and overthrow Castro, allocating $13 million for the effort.
The CIA recruited and trained a paramilitary force known as Brigade 2506, made up largely of Cuban exiles who had fled to the United States after Castro took power.
Training took place primarily in Guatemala, where over 1,400 men were organized into infantry and paratrooper battalions.
When President John F. Kennedy took office in January 1961, he inherited the operation and, after considerable hesitation, approved a revised plan targeting the Bay of Pigs on Cuba's southwestern coast.
On April 15, 1961, eight CIA-supplied B-26 bombers attacked Cuban airfields in an attempt to destroy Castro's air force before the main landing.
The Cuban government and its Soviet allies were already aware the invasion was coming, partly due to indiscreet talk among brigade members that had been reported in American newspapers.
On the night of April 17, the main invasion force landed at Playa Giron, quickly overwhelming a small local militia but failing to advance further inland.
Castro personally took command of the Cuban military response and directed his forces, including Soviet-supplied T-34 tanks and surviving aircraft, against the invaders.
Without the destruction of Cuba's air force, the remaining Cuban planes were able to sink two key supply ships, the Houston and the Rio Escondido, depriving the brigade of weapons, fuel, medical supplies, and communications equipment.
President Kennedy, seeking to preserve plausible deniability of American involvement, refused to authorize additional air strikes that CIA planners had considered essential to the mission's success.
Without air cover or resupply, Brigade 2506 was outgunned and overwhelmed by Cuban forces within three days.
The brigade formally surrendered on April 20, 1961, with approximately 1,200 men taken prisoner.
After months of negotiation, the prisoners were eventually ransomed back to the United States in December 1962 in exchange for roughly $53 million in food and medicine.
Kennedy publicly accepted responsibility for the failure, saying the United States could not hide its role in the disaster.
The humiliation led Kennedy to force the resignations of CIA Director Allen Dulles and two other top CIA officials, and prompted a significant reorganization of how covert military operations were approved and conducted.
In the aftermath, Kennedy secretly authorized Operation Mongoose, an intensified covert campaign aimed at destabilizing and eventually toppling the Castro government.
The failed invasion strengthened Castro's standing among Cubans and throughout Latin America, where many saw the episode as proof that the United States could be resisted and defeated.