By Michael Voss
BBC News, Havana
The news that Fidel Castro is stepping down as president after almost 50 years in power came in the middle of the night, through the online edition of the official Communist party newspaper Granma.
Fidel Castro has been a thorn in the side of 10 US president
Cuba's newly-elected parliament is due to meet for the first time this Sunday to elect a new executive council of state, whose president will become president of Cuba for a new five-year term.
Under the headline "Message from the Commander in Chief", the 81-year-old revolutionary leader wrote:
"I will not aspire to nor accept - I repeat, I will not aspire to nor accept - the post of President of the Council of State and Commander in Chief."
This effectively marks the end of an era.
Mr Castro has ruled this Caribbean island since the revolution in 1959. Most Cubans have known no other leader or system, with more than 70% of the population born after the revolution.
Mr Castro handed temporary power to his brother Raul a year-and-a-half ago after undergoing emergency surgery.
He has not been seen in public since then and had hinted in recent newspaper articles that he might be about to retire.
The last of the great Cold War leaders, Mr Castro came to power in 1959, reshaping Cuba into a communist state just 150km (93 miles) from the United States.
Apart from monarchs, he is the world's longest ruling head of state.
Famous for his beard, cigar and military fatigues he has long been an icon of the left and a thorn in the side of 10 US presidents.
His foes call him a dictator who drove Cuba to the brink of economic ruin and who imprisoned dissidents and opposition leaders in this one-party state.
He has survived assassination attempts, a failed invasion and a tough US embargo since he led the revolution.
The Cuban missile crisis 45 years ago was the closest the world has come to nuclear war.
Mr Castro pursued an egalitarian society, with free healthcare and education.
Opposition to Castro is strong among exiles in Miami
His control of power ensured Cuba remained communist long after the break-up of the Soviet Union and the collapse of communism across Eastern Europe.
Mr Castro's illness remains a state secret, though it is believed to be diverticulitis, an inflammation of the stomach.
In an interview last year the ailing Cuban leader said that he had undergone a series of operations.
When news of his illness broke, there was dancing on the streets of Miami as anti-Castro exiles wrongly assumed that the end was nigh and that Cuba's communist revolution could not survive without Fidel Castro at the helm.
A year-and-a-half later and Raul Castro appears to be firmly in control.
So far it has been a smooth transition, outwardly little has changed.
But in a keynote speech last year Raul Castro told the nation that "structural and conceptual" changes were needed to get the island's faltering economy back on its feet.
All of this has raised widespread expectations that major economic changes at least are on the way.
In recent months Raul Castro has initiated a wide-sweeping internal debate over what changes people want to see.
Earlier this month the BBC obtained a tape of one of these meeting, which showed students complaining about how low wages are, and asking why they could not travel abroad or have free access to the internet.
On the human rights front, Cuba has committed itself to signing the main United Nations conventions on human, political and economic rights later this year.
According to the illegal but tolerated Cuban Commission for Human Rights, there were 234 prisoners of conscience being held in Cuba, about 20% less than when Raul Castro took over. A further four prisoners were released over the weekend.
It is now widely expected that Raul Castro will be confirmed as official head of state on Sunday, although an outside chance remains that the baton could pass to one of the younger generation of communists, such as de facto Prime Minister Carlos Lage.