Luis Posada Carriles in 1985. (El Universal/AP)

Luis Posada Carriles, a Cuban-born former CIA operative who allegedly engaged for decades in terrorist action to overthrow Fidel Castro’s socialist dictatorship and was accused of orchestrating a string of deadly attacks on civilians, died May 23 at a hospital in Hollywood, Fla. He was 90.

He had throat cancer, his attorney, Arturo Hernandez, told the Associated Press.

In a life as improbable as it was notorious, Mr. Posada came from an upper-middle-class Cuban family, attended college in Havana a few years behind Castro (who he recalled “dressed like a gangster”), narrowly missed participating in the disastrous U.S.-backed Bay of Pigs invasion of Cuba, once escaped from a Venezuelan military prison disguised as a priest, was said to have masterminded the explosion of a Cuban jetliner and the bombing of hotels in Havana, played a supporting role in the Iran-contra scandal and was pierced by a dozen bullets during an attempt on his life in Guatemala.

Mr. Posada became one of the last and most vehement of a group of hardened Cuban exiles who believed any means were justified in overthrowing Castro’s government. He proclaimed himself a freedom fighter and called his self-published memoir “Los Caminos del Guerrero,” sometimes translated as “The Paths of the Warrior.”

“The Cubans referred to him as the Osama bin Laden of Cuba. He was public enemy number one,” said Peter Kornbluh, who directs the Cuba Documentation Project at the National Security Archive, an independent research center at George Washington University. “Posada was a lifelong purveyor of violence, a militant anti-Castro ­international terrorist.”

Mr. Posada, who was never convicted of violent crimes, maintained fervent support among many in the Cuban exile community.

Luis Posada Carriles in 2010, bearing the marks of a 1990 assassination attempt. (Alan Diaz/AP)

“The CIA taught us everything — everything,” Mr. Posada told the New York Times in 1998. “They taught us explosives, how to kill, bomb, trained us in acts of sabotage. When the Cubans were working for the CIA, they were called patriots. ‘Acciones de sabotaje’ was the term they used to classify this type of operation. Now they call it terrorism. The times have changed. We were betrayed because Americans think like Americans.”

Luis Posada Carriles was born in Cienfuegos, a coastal city in southern Cuba, on Feb. 15, 1928. His father owned a printing press and bookstore.

At 17, Mr. Posada entered the University of Havana. There, he said he encountered Castro, a law student who was making a name for himself on campus for his fiery, radical politics. Like many of his generation, Mr. Posada said he was opposed to Fulgencio Batista’s corrupt military junta, but he was even more offended by what he called Castro’s bullying tactics and gun-wielding coterie.

Mr. Posada studied chemistry before working for Firestone Tire and Rubber in Havana and Akron, Ohio. “To be frank, I was never interested in politics when I was young,” he told the Times. “Not until the revolution.”

After the 1959 revolution that overthrew Batista, Mr. Posada spent a short stint in a Cuban military prison for his open criticism of the new government’s confiscations of property and other actions he found morally objectionable. He once told the Miami Herald that he managed to escape and power his way into the Argentine Embassy at gunpoint, eventually gaining safe passage to Buenos Aires and then heading to Miami, a beehive of anti-Castro radicalism.

There, he volunteered for the CIA-trained force of Cuban expatriates planning the 1961 Bay of Pigs invasion. But he was in a planned second wave of invaders, and the operation failed before his plane left the ground in Guatemala.

Mr. Posada joined the U.S. Army and trained in intelligence and demolition work and continued his affiliation with the CIA before moving to Venezuela in 1967 to eventually become a leader in the country’s security police.

His mandate was to eradicate Castro-aligned left-wing guerrilla groups in the oil-rich nation. He oversaw a network of informants, including hot dog vendors and gardeners, and his men pilfered trash from the Cuban Embassy. But his reputation for violent excess — and rumors of his involvement with drug trafficking and gangsters — led to his firing in the mid-1970s.

The U.S. government also began to back away from any association with Mr. Posada, who tried to re-ingratiate himself with the CIA in the hope of getting American visas for him and his family. According to government documents released later, he told the spy agency of various plots, including one to blow up a Cubana Airlines jetliner, and reiterated his request for visas.

In October 1976, a Cubana DC-8 bound for Havana blew up soon after taking off after a stopover in Barbados, killing all 73 people on board, including teenagers from Cuba’s national fencing team. The explosives had been packed into a toothpaste tube.

Venezuelan investigators said they were able to trace the luggage carrying the explosives to men associated with Mr. Posada. He and several alleged accomplices spent the next nine years in a Venezuelan prison, all the while denying involvement. He bribed the warden and escaped in 1985, wearing clerical garb.

Via shrimp boat and then private plane, Mr. Posada made his way to El Salvador, where he became part of the covert weapons supply line to U.S.-backed contra rebels in Nicaragua battling the Marxist-Leninist Sandinista government. When the operation unraveled in 1986, after a contra supply plane was shot down, Mr. Posada turned to private security work in Guatemala.

He became a consultant to the democratically elected president, Vinicio Cerezo, who took power after a decades-long civil war and military dictatorship. Mr. Posada was tasked with watching out for a potential coup by disgruntled officers or assassination attempts by left-wing guerrillas. In 1990, gunmen shot him 12 times while his car was trapped in Guatemala City traffic.

He survived, thanks to a speedy ambulance, but his recovery took years and required many surgeries. His nerves were damaged, his mouth was disfigured, and he spoke with a gravelly whisper. “My chin used to be an inch longer, very nice,” he quipped to the Times in 1998. “I was very handsome once.”

He claimed the would-be assassins worked for Cuban intelligence, but his shadowy activities made him the target for many groups throughout the hemisphere. During these roiling years, he told the Times, he was supported financially by friends in Miami.

Into his senior years, Mr. Posada drew attention for his possible ties to violent acts against Cuba. A series of bombs were detonated at upscale Havana tourist spots in 1997, and Mr. Posada in his 1998 interview with the Times appeared to admit his role in plotting the operation as an effort to disrupt the lucrative tourism trade; he later backed away from the claim. An Italian vacationer was killed and several others were injured in the explosions.

In 2000, Mr. Posada was taken into custody in Panama for his alleged involvement in a plan to assassinate Castro, who was visiting for a summit. Mr. Posada received a presidential pardon after serving four years. He then entered the United States illegally and sought political asylum, which led to his trial in 2011 on immigration-related charges. A federal jury in El Paso acquitted him.

Mr. Posada’s brief first marriage ended in divorce. Survivors include his second wife, Elina Nieves, and their two children.

If Mr. Posada did not fulfill his ultimate goal, he did outlive Castro by a year and a half. He railed against the restoration of diplomatic relations between Washington and Havana in 2015, reportedly saying at a Miami street demonstration: “It will not succeed. You cannot do business with bandits.”

He once pointed to the irony of his involvement with anti-Castro activity while his parents and three siblings remained loyal to the revolution. A sister became a colonel in the Cuban army and wed a colonel who did intelligence work. “I help her with money now and then,” he told the Times.