Fidel Castro revealed Thursday that he thought he was dying when he fell seriously ill in July 2006, and he hastily made plans to give up power as doctors fought to save his life.

"When I fell gravely ill the night of the 26th and dawn of the 27th of July, I thought that would be the end, and while the doctors fought for my life, the head aide of the Council of State read at my urging the text and I dictated the necessary arrangements," the ailing 81-year-old wrote in an essay published on the front page of state newspapers.

Castro has not been seen in public since July 31, 2006, when he said in a statement that emergency intestinal surgery was forcing him to cede power to a provisional government headed by his younger brother Raul. Though he no longer runs Cuba's government, he has retained his role as head of the island's supreme governing body, the Council of State.

A new slate of Cuban lawmakers meets next month and will choose a new Council of State from among its ranks, which include both Castro brothers. Fidel Castro has not said whether he wants to remain head of the council or permanently retire.