Fidel Castro, the Cuban revolutionary leader who built a communist state on the doorstep of the United States and for five decades defied U.S. efforts to topple him, He was 90.

Castro, in poor health since an intestinal ailment nearly killed him in 2006.

The bearded Fidel Castro took power in a 1959 revolution and ruled Cuba for 49 years with a mix of charisma and iron will, creating a one-party state and becoming a central figure in the Cold War.

He was demonized by the United States and its allies but admired by many leftists around the world, especially socialist revolutionaries in Latin America and Africa.

Transforming Cuba from a playground for rich Americans into a symbol of resistance to Washington, Castro outlasted nine U.S. presidents in power.

He fended off a CIA-backed invasion at the Bay of Pigs in 1961 as well as countless assassination attempts.

His alliance with Moscow helped trigger the Cuban Missile Crisis in 1962, a 13-day showdown with the United States that brought the world the closest it has been to nuclear war.

Wearing green military fatigues and chomping on cigars for many of his years in power, Castro was famous for long, fist-pounding speeches filled with blistering rhetoric, often aimed at the United States.

At home, he swept away capitalism and won support for bringing schools and hospitals to the poor. But he also created legions of enemies and critics, concentrated among Cuban exiles in Miami who fled his rule and saw him as a ruthless tyrant.

In the end it was not the efforts of Washington and Cuban exiles nor the collapse of Soviet communism that ended his rule. Instead, illness forced him to cede power to his younger brother Raul Castro, provisionally in 2006 and definitively in 2008.

Although Raul Castro always glorified his older brother, he has changed Cuba since taking over by introducing market-style economic reforms and agreeing with the United States in December to re-establish diplomatic ties and end decades of hostility.

Six weeks later, Fidel Castro offered only lukewarm support for the deal, raising questions about whether he approved of ending hostilities with his longtime enemy.

In his final years, Fidel Castro no longer held leadership posts. He wrote newspaper commentaries on world affairs and occasionally met with foreign leaders but he lived in semi-seclusion.

His death – which would once have thrown a question mark over Cuba’s future – seems unlikely to trigger a crisis as Raul Castro, 85, is firmly ensconced in power. (Reporting by Daniel Trotta and Marc Frank; Editing by Kieran Murray and Simon Cameron-Moore)