Raul Castro has long been next in line after his brother

A statement written by the president and read out on TV by his personal secretary said Mr Castro had undergone surgery to halt internal bleeding.

The Cuban leader, who turns 80 this month, said a punishing schedule in recent weeks had affected his health.

This is the first time Mr Castro has relinquished any of his duties since he came to power in 1959.

Raul Castro, the defence minister, has long been designated as his successor should he become incapacitated.

Cuba has a communist, one-party system.

Stress

In his statement, Fidel Castro said a recent trip to Argentina and last week's anniversary of the Cuban Revolution had caused him "days and nights of non-stop work" and put him under "extreme stress".

Resulting intestinal bleeding, he said, meant he needed an operation which would require several weeks of rest.

"Since our country is threatened by the US Government under circumstances such as these," the statement said, Mr Castro had delegated his functions as president and first secretary of the Communist Party to his brother Raul, who is 75.

A major celebration had been planned for 13 August - the veteran leader's 80th birthday - but the event has now been postponed until December.

The BBC's Stephen Gibbs in Havana says the fact that the Cuban leader did not appear in person to read the letter has added to speculation about the gravity of his condition.

HAVE YOUR SAY Like 95% of Cuban-Americans I am extremely happy about this news

George, New York City, USA

Send us your comments

He says there is no question that something serious is happening, and this may be a major turning point for Cuba.

Handing over the reins of power will be a shock to many Cubans, 70% of whom have known no other leader, our correspondent says - and the external enemies of Mr Castro will doubtless believe this is the moment for change.

Fidel Castro has been among the world's longest-ruling leaders - outlasting nine US presidents.

Glee in US

The news prompted scenes of wild celebration on the streets of Miami on Monday night, as thousands of people danced, banged cooking pots and chanted "Cuba, Cuba, Cuba!"

"There has never been anything that has given the people so much hope," Armando Tellez, 33, told the news agency AP.

Others, like Miguel Saavedra, the leader of a conservative Cuban exile group, speculated that Mr Castro had already died.

"Castro is dead ... why is he dead? Because the government they give a lot of information to the whole world that Castro passed his power to the brother ... this news now is the best news... for 48 years," Mr Saavedra said.

But others were more circumspect, noting that Mr Castro has survived several health scares.

In 2001, he fainted briefly during a speech.

And in 2004, TV cameras captured the moment when Mr Castro slipped and fell, breaking his knee and fracturing his arm.

The White House said it was monitoring the situation, but did not wish to speculate on Mr Castro's health.

"We will continue to work for the day of Cuba's freedom," said spokesman Peter Watkins.