Fidel Castro, who will turn 80 on Sunday, issued a statement saying that he had suffered from an "accident" and had passed power to his brother Raul, the minister of defence.
The intense agenda of a recent trip to Argentina "caused an acute intestinal problem, with sustained bleeding, which forced me to undergo a complex surgical operation," he said in a statement read over radio and television by his personal secretary Carlos Valenciaga on Monday night.
Castro said in the statement the operation has forced him to be "out of power for several weeks". He said he has delegated his powers to his brother Raul, 75, until he recovers.
Castro, who has been in power for almost 48 years, joked last week that he did not plan to be leading Cuba if and when he hits the 100-year mark.
Speculation about Castro's health peaked after a fall in 2004, when he injured his right arm and left knee.
Last November, the Cuban leader, who stopped smoking cigars in 1985 and now exercises every day, said he had recovered from these injuries.
Castro leads the only communist, one-party regime in the Americas, has lashed out at a US plan to "assist" in a transition once he no longer holds power.