Cuban leader Fidel Castro, the charismatic image of leftist revolution who thrust his Caribbean nation onto the world stage by provoking Cold War confrontation and defying U.S. policy through 11 administrations, has died.

He was 90.

With his trademark fatigues and scruffy beard, Castro wore his defiance of Western capitalism like a badge of honor, accomplishing the unlikely feat of keeping communism alive in the Western Hemisphere two decades after the fall of the Soviet Union.

After early successes in health care and education, his government lost much of its luster in later years as it failed to create economic opportunities and authorities resorted to repression to maintain control.

His last years were spent quietly as his brother Raul took the helm. The younger Castro launched cautious reforms in an effort to steer Cuba out of poverty, and in July 2015 restored diplomatic relations with the United States after a half-century breach.

For decades, however, Fidel Castro outmaneuvered his powerful neighbor, coming out on top in the Bay of Pigs invasion in 1961, the Mariel boatlift in 1980 and the bitter custody battle over young castaway Elian Gonzalez in 2000.

Castro's revolution touched off an exodus, and the thousands of Cubans who reached Florida forever changed the character, culture and politics of the state.

Castro, the longest-reigning of the 20th-century caudillos — Latin American military rulers — blamed the U.S. economic blockade, not his government's economics, for the steady erosion of living standards in Cuba.

While a succession of U.S. presidents and hard-line Cuban exiles in Miami saw a dictator who trampled on the rights of his people, Castro won acclaim among Latin Americans who envied his nationalist dignity and cavalier attitude toward the powerful yanquis.

“No sober person in Latin America wants to adopt the Cuban system. But wherever he went in Latin America he received a raving ovation,” said Wayne Smith, a veteran U.S. diplomat who served in Havana. “Why? Because he stood up to the United States, told us where to go, and got away with it.”

That stance against U.S. domination propelled Castro to the forefront of Latin America's quest for social justice throughout the politically charged decades that followed World War II. But he squandered many gains of his revolution by refusing to ease his grip on power or the economy.

Resentful youth

Fidel Alejandro Castro Ruz was born Aug. 13, 1926. Never christened, he was teased by neighborhood children as “the Jew” and was barred from a Roman Catholic elementary school near home, forcing his exile to a boarding school.

Castro attended a Jesuit academy before studying law at the University of Havana.

Castro earned his law degree in 1950, and in 1952 planned to run for a parliamentary seat. But the election was canceled after military chief Fulgencio Batista overthrew the government and imposed a dictatorship.

Castro organized a revolutionary movement. He led a handful of followers in an attack on the Moncada military barracks in Santiago de Cuba on July 26, 1953. The assault failed miserably, scattering the survivors to the mountains of the Sierra Maestra, where they were tracked down and arrested.

Castro drew a 15-year sentence but was released after two years in a general amnesty and went to Mexico. There, he Ernesto “Che” Guevara.

Jorge Castaneda, former Mexican foreign minister, chronicled the relationship in his 1997 book, “Companero: The Life and Death of Che Guevara.”

“Fidel's passion for Cuba and Guevara's revolutionary ideas ignited each other like wildfire, in an intense flare of light. One was impulsive, the other thoughtful; one emotional and optimistic, the other cold and skeptical. Without Ernesto Guevara, Fidel Castro might never have become a communist. Without Fidel Castro, Ernesto Guevara might never have been more than a Marxist theoretician, an idealistic intellectual,” Castaneda wrote.

Revolution

Castro, Che and 80 followers left for Cuba on Nov. 25, 1956. When they arrived, the guerrillas took to the mountains.

The revolutionaries waged a two-year campaign of harassment, ambushing columns of troops and taking several small towns before surrounding Santiago in late 1958. Batista fled to the Dominican Republic as the new year arrived.

A jubilant Castro proclaimed victory New Year's morning and spent weeks in triumphant processions throughout the country.

President Dwight Eisenhower slapped a trade embargo on Cuba in October 1960 and severed relations with Havana three months later.

Countless biographers, interviewers and political scientists contend that Washington's rejection of Castro, encouraged by Batista supporters who had fled to the United States and whose homes and businesses in Cuba had been seized, pushed him toward authoritarianism and into the arms of the Soviet Union.

It wasn't until the eve of the Bay of Pigs invasion, more than two years after he took power, that Castro proclaimed himself a Marxist-Leninist.

The April 1961 invasion was Castro's legend-making defeat of the U.S. Goliath, after 1,400 invading exiles deposited on Cuban shores by the U.S. Navy were quickly overwhelmed.

Beholden to Moscow for aid and fearful of another U.S. attack, Castro allowed the Soviet military to install medium-range missiles on Cuban territory in 1962, instigating a high-stakes showdown between the Cold War superpowers that brought the world to the brink of a nuclear war.

During the Cuban missile crisis that October, probably his country's most stunning moment in the international spotlight, Castro was said to have become enraged when Soviet and U.S. officials negotiated an end to the standoff without his participation.

Total control

Castro nationalized industrial assets across the country, infuriating sugar, rum and cigar czars and laying the foundation for decades of economic conflict with the United States.

In April 1980, Castro showed his skill at turning defeat into victory by using a refugee crisis, when 10,000 Cubans seeking to flee the island flooded the Peruvian Embassy in Havana.

Castro said the asylum-seekers were free to leave from the port of Mariel, and he emptied prisons and mental hospitals and sent the inmates to join the flotilla.

Through his defense minister and brother, Raul, Castro trained and augmented leftist guerrillas around the world starting in the 1970s. At least 2,000 troops died serving their “internationalist” duty, mostly in Angola.

Despite economic problems, Cuba made impressive progress in literacy, higher education and health care during Castro's reign.

University enrollment was higher than in many more prosperous countries. Castro's “literacy brigades” helped lift the quality of life in the countryside. Infant mortality and life expectancy also improved dramatically.

Though never clearly embracing the atheism espoused by most communist leaders, Castro banned public celebrations of Christmas until Pope John Paul II made reversal of that order a condition of his historic 1998 visit.

After the Soviet Union's dissolution and an abrupt end to Moscow's subsidies to Cuba, Castro agreed to allow some minor economic liberalization to attract foreign investment.

Cuban state companies collaborated with Canadian, Japanese and European counterparts to create a thriving tourism sector.

The Baltimore Orioles traveled to Havana in 1999 to play a goodwill game against a team of Cuban all-stars.

Orioles owner Peter Angelos said he hoped that some well-intentioned sports diplomacy would help improve relations between the United States and one of its Cold War enemies.

At the game, the party-loyalist-only sellout crowd went nuts when Fidel Castro marched across the field to shake hands with the Orioles players.

Angelos and baseball commissioner Bud Selig were criticized for sitting next to Castro during the game, but Angelos offered no apology for what he said was a diplomatic necessity.

A few months later, the game in Baltimore was played under the shadow of possible Cuban defections. Demonstrations were held outside the stadium and the game was briefly interrupted when a handful of anti-Castro demonstrators ran onto the field and were arrested.

But Angelos said last spring — as the Tampa Bay Rays prepared to visit Cuba — that he considered the venture a big success.

“It was a truly satisfying experience,” Angelos said, “because these were people who were just like our people. They were people who loved baseball and there was nothing they wouldn't do for us while we were there.”

On Thanksgiving Day in 1999, a 5-year-old Cuban boy named Elian Gonzalez washed up on Florida's shores, one of only three survivors of an escape in which his mother and 10 others drowned.

The subsequent custody battle between Elian's anti-Castro relatives in Miami and the Cuban government ultimately gave Castro a platform to bolster his image as protector of Cuban sovereignty in the face of Yankee aggression.

U.S.-Cuban tensions seemed to be easing when, in 2003, the Cuban government jailed 75 dissidents pushing for democratic reforms. The last of them were finally released in 2011.

Former Maryland aid worker Alan Gross was imprisoned in Cuba for five years before he was released in December 2014.

Gross, a subcontractor to the U.S. Agency for International Development, was held in a Cuban prison for trying to connect the island's small Jewish community to the internet.

He was convicted by a Cuban court of crimes against the state and sentenced to 15 years.

On Saturday, Gross reacted to the death of Fidel Castro on Twitter, writing, “History will never absolve him. But perhaps now the voices of Cuba will be heard. Speak up, Cuba.”

Now 67, Gross resides in Washington, D.C.

Last years

In his later years, Castro appeared increasingly frail. It was his hectic travel schedule in July 2006 that he blamed for the intestinal bleeding that led to surgery and compelled the first transfer of governing authority, to brother Raul, in the more than 47 years he had ruled the country.

As Fidel Castro's official role faded (he relinquished his last leadership post, as head of the Communist Party, in April 2011), Raul consolidated his own power and embarked on a reform program that would have been unthinkable under his brother. The changes included allowing Cubans to buy and sell cars and homes, to open small businesses and to leave the country without applying for government permission.

On Dec. 17, 2014, Raul Castro and President Barack Obama announced a turnaround in U.S.-Cuban relations with their promise to restore diplomatic ties and bring the two nations into a more congenial relationship. An end to the U.S. embargo of Cuba, however, depends on action by Congress, where much opposition remains to normalizing relations with Havana.

To the end, Castro clung to his belief that his revolution had succeeded in lifting a nation above self-interest and material obsessions.

His words to the court that tried him for the Moncada attack more than half a century ago echoed throughout his long career and late-night monologues. “Judgment is spoken by the eternal court of history,” Castro said then of his actions. “Condemn me, it does not matter. History will absolve me.”

Baltimore Sun reporter Peter Schmuck contributed to this article.