Fidel Castro has not been seen in public since his operation in July
Castro's career
The 81-year-old handed over power temporarily to his brother Raul in July 2006 when he underwent surgery and has not been seen in public since then.
Cuba's new parliament will meet on Sunday to elect a new president.
Washington has called for Cuba to hold free elections, and said its decades-long embargo would remain.
This should be a period of democratic transition for the people of Cuba
US President George W Bush
Reaction in quotes Cold War to thaw? Send us your reaction
President George W Bush said the US was ready to help the "people of Cuba realise the blessings of liberty".
A senior US state department official, John Negroponte, added that the 1962 embargo would probably not be lifted "any time soon".
The European Union said it hoped to relaunch ties with Cuba that were almost completely frozen under Mr Castro, while China described Mr Castro as an old friend and said it would maintain co-operation with Cuba.
Mr Castro has ruled Cuba since leading a revolution in 1959.
The BBC's Michael Voss reports from Havana that most Cubans will be saddened by news of their leader's retirement, but many hope the political transition will bring economic improvements.
Soldiering on
Mr Castro made his announcement in a letter published on the website of the Cuban Communist Party's newspaper Granma in the middle of the night, Cuban time.
He said he would not accept another five-year term as president when the National Assembly met on Sunday.
"It would betray my conscience to take up a responsibility that requires mobility and total devotion, that I am not in a physical condition to offer," he wrote.
Mr Castro said he had not stepped down after undergoing emergency intestinal surgery in 2006 because he had had a duty to the Cuban people to prepare them for his absence.
But retirement, he added, would not stop him from carrying "on fighting like a soldier of ideas", and he promised to continue writing essays entitled Reflections of Comrade Fidel.
"I will be one more weapon in the arsenal that you can count on," he said.
Search for new leader
The National Assembly is widely expected to elect Raul Castro, 76, as Fidel's successor.
FIDEL CASTRO Born in 1926 to a wealthy, landowning family Took up arms in 1953, six years before coming to power Brother Raul was deputy and Che Guevara third in command Has outlasted nine American presidents Target of many CIA assassination plots Daughter is a dissident exile in Miami
Castro's life in pictures
He has mooted major economic reforms and "structural changes".
But some analysts see a possible generational jump, with Vice-President Carlos Lage Davila, 56, a leading contender.
Anyone hoping that Fidel Castro's departure from the political scene would bring about the end of the communist regime was disappointed, the BBC's Nick Miles reports.
Whilst Cuban exiles celebrated in Miami, Florida, there were no protests on the streets of Havana calling for political change.
In part, our reporter says, this is because the regime does not tolerate dissent - but it is also because many in Cuba are wary of what change will probably mean: a mass influx of exiles returning from Miami.
Raul Castro has worked to ensure a smooth political transition, keeping the army loyal to the regime and strengthening the Communist Party's hold by introducing reforms and weeding out corrupt officials.
He has also had the advantage of continued economic support from Venezuelan President Hugo Chavez in the form of millions of barrels of cheap oil, our reporter adds.
Mixed legacy
It is not clear whether Mr Castro's retirement was prompted by a further decline in his health - the state of which is an official secret.
Though Fidel Castro has not been seen in public for 19 months, the government occasionally releases photographs and pre-edited video of him meeting visiting leaders from around the world.
The retiring leader will be remembered as one of the most distinctive and enduring icons from the second half of the 20th Century, the BBC's Paul Keller writes.
With his olive green fatigues, beard and Cuban cigars, Fidel Castro was the original Cold Warrior.
Under his leadership Cuba established the first Marxist-Leninist state in the Western hemisphere, almost within sight of the US coastline.
Embracing communism and the patronage of the Soviet Union, Fidel Castro transformed Cuba economically and socially but had to struggle when it collapsed.
He leaves his country with universal free healthcare and a much-admired education system, which has produced doctors for the developing world, but also a failing economy.
Fidel Castro, the Cuban president who seized power in a 1959 revolution, has stated in a quote in Cuba's state-run newspaper ''Granma'' that when the National Assembly of Cuba meets on February 24 he "will not aspire to or accept... the positions of President of Council of State and Commander in Chief."

81-year-old Castro handed over control to his 76-year-old brother Raúl when he underwent surgery in July 2006. "It would betray my conscience to take up a responsibility that requires mobility and total devotion, that I am not in a physical condition to offer," Castro explained.

United States President George W. Bush said, "I believe that the change from Fidel Castro ought to begin a period of democratic transition."  Although, John Negroponte, Deputy Secretary of State, said that this does not mean that the 1962 trade embargo will be lifted "any time soon."

European Union said that it hopes to improve relations with Cuba, which were almost at a standstill under Castro. Spokesperson John Clancy said the EU is willing to engage with Cuba in constructive dialogue to foster a peaceful transition to pluralistic democracy in Cuba.

China said it will maintain its current cooperation with Cuba and termed Fidel Castro an old friend. A spokesperson for the foreign ministry of Vietnam similarly praised Castro as a great friend and comrade.

BBC reports that Raúl Castro is seen by analysts as the likely choice as successor by the National Assembly, though some see 56-year-old Carlos Lage Dávila as potential candidate. Lage is currently Vice-President and Executive Secretary of the Council of Ministers.

The decision is scheduled for February 24, 2008.