Fidel Castro, Cuba’s longtime former president, has delivered a farewell speech to the Communist party Congress in the capital, Havana, and called for safeguarding communist ideals.

The leader of the 1959 revolution, which overthrew the US-backed dictator Fulgencio Batista, emerged from seclusion on Tuesday to muse about death and provide encouragement to his followers in a rare speech.

"Soon I will be 90 years old," he said. "Soon I will be like all the rest. Everybody's turn comes," Castro, whose birthday is August 13, told 1,300 party activists gathered at a Havana convention centre where he delivered countless, hours-long speeches during his rule.

Castro held power for nearly five decades before ill health led him to make way for his brother Raul Castro, 84, in 2006.

"Perhaps this will be one of the last times I speak in this room," said Castro, sporting a blue tracksuit jacket, glasses and wispy grey beard.

"The ideas of Cuban Communists will remain," he said, "as proof that on this planet, if you work hard and with dignity, you can produce the material and cultural goods human beings need."

WATCH: Did Fidel Castro win?

Cries of "Fidel, Fidel" once again rang out as the now frail former leader made his most extensive public appearance in years, speaking with a strong, if slightly hoarse voice.

"We must tell our brothers in Latin America and the world that the Cuban people will be victorious."

But the twice-a-decade Communist Party congress proved a disappointment to many residents, especially the youth, re-electing an ageing leadership and proposing little new to tackle the country's economic problems.

As well as being the president, Raul Castro, 84, is also the party's first secretary - a position considered at least as powerful as the presidency even after he is presumably replaced by a younger president in 2018.

The Cuban president indicated that he may also step down before the next congress in 2021.

As with other stage-managed appearances in recent years, Castro was not shown standing, but he looked healthier than he had for a long time after a serious illness that led him to relinquish power 10 years ago.

The congress reviewed difficulties the party faces implementing market reforms, maintaining its leadership over an increasingly diverse and informed population and dampening expectations raised by detente with the United States and President Barack Obama's visit to the country last month.

RELATED FEATURE: From Elvis to Castro: The man selling Canada to Cuba

The visit provoked Castro earlier to say that Obama was sweet-talking Cubans and had nothing to offer them, a view repeated by various delegates at the congress.

Fidel Castro took power in a 1959 revolution and led the country until 2006, when he fell ill. He now lives in relative seclusion but occasionally writes opinion pieces or appears meeting with visiting dignitaries.