Venezuelan President Hugo Chavez said Thursday that Fidel Castro is in a "great battle for life," but said the Cuban leader himself gave him reason to be optimistic about a quick recovery.

"From here, let's pray to God for Fidel and his recovery, and he's fighting a great battle," Chavez said in a televised speech from the eastern state of Anzoategui.

His statement was the most serious yet from a close Castro ally in describing the 79-year-old Cuban leader's condition. But he also predicted, with a laugh, that Castro would defy the U.S. government's plans for a transition on the island and emerge from a hospital where he is being treated to reassume the presidency.

Chavez said a messenger brought him word from Castro himself on Wednesday — "a message that filled me with more optimism, with more faith."

"Among other things Fidel told me ... 'I keep saying Chavez, God help Chavez and his friends,"' Chavez said.

"I wrote to him in my own handwriting last night, in the early morning, to send it with the messenger who was returning immediately: 'You are fighting a great battle every day, all these nights," Chavez continued.

"I told him, 'Here we're with you every second, every minute, every hour, every day, every night of that great battle for life that you are fighting from your heart, from your soul, from your innards, from your greatness," Chavez said. "It's a battle, and I know, Fidel, that we're going to win it, too. We are prevailing and we will prevail."

Chavez described Castro's health troubles as an "ambush," coming so soon after Castro gave a three-hour speech in Cordoba, Argentina, and visited the childhood home of his fellow revolutionary Ernesto "Che" Guevara.

Chavez said he and Castro hugged at the door of the plane, promised to see each other again soon, "and then suddenly the surprise, but that's life."

"It's life, biology," Chavez said. "And it's also 80 years that you've lived, Fidel Castro, and what an 80 years Fidel has lived."

Castro said July 31 he was stepping aside temporarily, granting his powers to his brother Raul as head of the government and the Communist Party so he could recover from intestinal surgery.

Neither brother has been seen in public since then. Details of Castro's condition, his ailment and the surgical procedure he underwent are being treated as a state secret.

Chavez said there will be a transition in Cuba, but not away from Castro's socialist system as officials in Washington are hoping.

"The gringos have prepared for many years, in the case of Cuba, to face the situation of Cuba with Fidel, and they also prepared for the situation of Cuba without Fidel," Chavez said.

"Now they're faced with an unprecedented situation — Fidel is there but he isn't. So they don't know what to do," Chavez said with a laugh. "When Fidel leaves the hospital where he is, there will be a transition. Raul will once again hand over power to Fidel."

During his televised speech, Chavez spoke near the end as if he thought Castro were listening.

"Get better, Fidel. It's an order. I never give you an order. Now I'm giving you one," Chavez said. "Get better, an order. I know you're disciplined."

The Venezuelan leader, who is Castro's closest international ally, has said he will dedicate his weekly TV and radio program, "Hello President," this Sunday to Castro in honor of his 80th birthday.