MIAMI – “I believe that one has to be consistent right up to the end,” Fidel Castro wrote in his resignation letter Tuesday, and he was. The world may long argue whether the Cuban president was a communist or a social reformer, a mad tyrant or a visionary savior, but no one will ever doubt that he was a shrewd survivor who left power just as he ruled: on his own terms.

Defying the expectations – and, in many cases, the hopes – of an eternally bemused world, Castro bowed out not a step or two ahead of an enemy tank or a mob of angry voters, but on a timetable of his own choice, handing Cuba over like a family heirloom to his little brother.

He outlived the Soviet Union, the nation that inspired him, succored him and sometimes betrayed him. He outlasted nine U.S. administrations that tried, with varying degrees of enthusiasm, to topple him. He outstayed dozens of unelected dictators, from Augusto Pinochet to Saddam Hussein, who came and went while he ruled in Havana.

Aside from his aversion to elections – the bullets fired on his behalf were better than ballots, Castro said, for “it is not only with a pencil marking a ballot, but also with blood, that a people can take part in a patriotic life” – he was anything but rigid in his ideology.

If economic times were hard, he might crack the door to permit private restaurants and small businesses, then slam it shut with a two-hour speech denouncing the creeping revisionism of Havana hot-dog vendors. If there was a current of political restlessness, he might allow dissidents to speak up a little, then jail them. If he needed a favor from Washington, he might reach out, then lash back with something like the Mariel boatlift. Castro was so flexible when it came to political tactics that scholars and journalists argue to this day whether he’s a Marxist-Leninist or simply a guileful practitioner of “wily political opportunism,” as one historian put it.

But of his survival skills, there was no dispute. Castro withstood Mafia hitmen, CIA-backed invasions, the collapse of world communism, a four-decade U.S. economic embargo and the mortal hostility of millions of his own countrymen. If he had regrets, as Frank Sinatra used to sing, they were too few to mention. “I distrust the seemingly easy path of apologetics or its antithesis of self-flagellation,” he wrote in his farewell letter.

That, too, is consistent. Castro has never apologized: not in 1953, when he sent his first rag-tag band of followers on a suicidal attack against a military barracks that ended with nearly all of them tortured, dead or both. (“History will absolve me,” he proclaimed in a speech at his trial that was partly cadged from Adolf Hitler.) Not in 1961, when he went on TV to tell the Cuban people he had been deceiving them all along and he drew his inspiration not from Marti but Marx. Not in 1963, when his attempt to install Soviet missiles on his island came so breathtakingly close to ending in nuclear war that even his allies in Moscow were rattled.

Hardship, he explained, was the lifeblood of the revolution. “I feel my belief in sacrifice and struggle getting stronger,” Castro told his countrymen. “I despise the kind of existence that clings to the miserly trifles of comfort and self-interest.”

At the beginning, at least, many believed. When Castro rode into Havana on a tank Jan. 8, 1959, after toppling the inept dictator Fulgencio Batista, the streets were filled with cheering throngs. So strong was Castro’s charisma that millions of Cubans continued to support him even as he jailed, exiled or executed political opponents and even apostate followers.

Barely 31, sporting a beard and a jaunty cigar, he seemed – not just to Cubans, but to followers all over the world – to mark a clean break with a corrupt, imperial past. His quick political collision with the United States over nationalization of U.S.-owned companies on the island only enhanced his underdog romanticism.

But Cuban political and economic independence proved just as illusory as the elections Castro promised in the early days of the revolution. Over the next five decades, the island would be yoked more firmly to first the Soviet Union and later Venezuela than it ever was to the United States, its economy surviving only on the $6 billion a year subsidies from friends flush with oil money.

His blood feud with the United States muffled criticism of Castro overseas, where resentment of Washington’s power festered. At home, it was more difficult. As political freedoms wilted under the watchful eye of Cuba’s ministry of the interior and the economy crumbled under the weight of Castro’s eccentric micromanagement, millions of Cubans either bolted (3 million, more than a fifth of the population, now live outside the country) or retreated into sullen despair.

By the 1990s, the island’s suicide rate had tripled from pre-revolutionary levels, and one of every three pregnancies ended in abortion. The birth rate has dropped so low that Cubans are not even replacing themselves: Women average less than two children apiece.

“There are a number of factors feeding into the birth rate,” said Lisandro Perez, a Florida International University sociology professor who studies Cuba. “But one of them is certainly that having children is an investment in the future, and a lot of Cubans aren’t willing to do that.”

Many economists believe Cuba, caught in a pincer of economic and demographic failures, is no more than a year or two from a major crisis, much worse than the one it faced when the Soviet Union collapsed. If so, Castro’s political timing is once again perfect.

“He’s leaving behind a mess,” said Edward Gonzalez, an emeritus political science professor at UCLA who consults for the Rand Corporation. “And now someone else will have to clean it up.”