Former Cuban leader Fidel Castro told an interviewer there were times during his long illness when he was at death's door but now he is mostly recovered and trying to avert nuclear war.

Castro, 84, told Mexico's La Jornada in an interview published on Monday that he was in such bad shape after falling ill four years ago that he no longer aspired to live, much less anything else.

He said he asked himself if those people (doctors) were going to let me live in those conditions or if they were going to let me die.

Then I survived but in very bad physical condition, said Castro, who underwent emergency surgery in July 2006 for a still-undisclosed intestinal illness, and then endured several following operations.

Lying in that bed, only seeing my surroundings, ignorant of all those machines, the longtime U.S. foe said. I didn't know how long that torment was going to last and the only thing I hoped for was the world to stop, he said in what the newspaper described as a five-hour conversation in Havana.

But I revived, Castro said in the second interview he has given since reappearing in July after four years out of public view. Earlier this month, he spoke to television reporters from Venezuela.

Castro, who ruled Cuba for 49 years before officially resigning as president in 2008, has for the past several months written and spoken frequently about the danger of a coming nuclear war.

He has warned it will break out if the United States, in alliance with Israel, attempts to enforce international sanctions against Iran for its nuclear activities.

Castro said his goal is to form an anti-nuclear war movement by creating a force of international persuasion to avoid that colossal threat.

In the meantime, his recovery continues as he works to regain strength in legs weakened by months in a hospital bed and to put on lost weight.

He told La Jornada he walked 600 steps without help and now weighed 190 pounds (86 kilos), up from pounds (66 kilos) at the depths of his illness.

I don't want to be absent in these days, he said. The world is in a the most interesting and dangerous phase of its existence.

I still have things to do.

(Reporting by Jeff Franks; Editing by Bill Trott)