Fidel Castro has given a speech to Cuba's Communist Party members saying he will die soon and urging them to help his ideas survive.
"I'll be 90 years old soon," Mr Castro said in his most extensive public appearance in years.
"Soon I'll be like all the others. The time will come for all of us, but the ideas of the Cuban Communists will remain as proof on this planet that if they are worked at with fervour and dignity, they can produce the material and cultural goods that human beings need, and we need to fight without truce to obtain them."
Mr Castro spoke as the government announced that his brother Raul will retain the Cuban Communist Party's highest post alongside his hardline second-in-command.
The announcement and Mr Castro's speech together delivered a resounding message that the island's revolutionary generation will remain in control even as its members age and die, relations with the United States are normalised and popular dissatisfaction grows over the country's economic performance.
Government news sites said Raul Castro, 84, would remain the party's first secretary and Jose Ramon Machado Ventura would hold the post of second secretary for at least part of a second five-year term. Raul Castro is currently both president and first secretary. The decision means he could hold a Communist Party position at least as powerful as the presidency even after stepping down from the government post in 2018.
Mr Machado Ventura, 85, is known as an enforcer of Communist orthodoxy and voice against some of the country's biggest recent economic reforms who fought alongside the Castro brothers to overthrow dictator Fulgencio Batista in 1959.
Fidel Castro made his rare appearance at the Communist Party congress to rousing shouts of his name, according to state media that showed a delayed, edited broadcast of the day's events.
Government-run television showed rare images of the 89-year-old seated at the dais in Havana's Convention Palace, speaking to the crowd in a strong but occasionally trembling voice and pausing occasionally to consult a written version of his speech.
Raul Castro's decision to remain in power alongside a deputy even he has criticised for rigidity capped a four-day meeting of the Communist Party notable for its secrecy and apparent lack of discussion about substantive new reforms to Cuba's stagnant centrally-planned economy.
Even high-ranking government officials had speculated in the weeks leading up the Seventh Party Congress that Mr Machado Ventura could be replaced by a younger face associated with free market reforms.
The party congress also chose the powerful 15-member Political Bureau, mostly devoid of fresh faces associated with the party's younger generations. Five members were new but none are high-profile advocates for reform.
Esteban Morales, an intellectual and party member who had complained about the secrecy of the congress, said he was gratified by Raul Castro's decision to submit the guidelines approved by the 1,000 delegates to an ex-post-facto public discussion and approval.
He said he expected the first and second secretaries to remain in their positions only until Raul Castro leaves the presidency in 2018, after what Mr Morales called a necessary transition period.
Mr Machado Ventura organised a network of rebel field hospitals and clinics in the Sierra Maestra mountains in the 1950s, participating in combat as both a medic and a fighter in the revolution against Batista. After the revolution he became health minister and later assumed more political roles within the Communist Party. He also sat on the powerful Politburo starting in 1975.
Mr Machado Ventura was vice president from Raul Castro's ascent in 2008 until 2013, when the post was taken by Miguel Diaz-Canel, widely seen as the country's likely next president. Mr Machado Ventura was named second secretary in 2011 in a move seen as a way to placate and empower party hardliners.
Mr Machado Ventura was often employed by Raul and Fidel Castro to impose order in areas seen as lacking discipline, most recently touring the country to crack down on private sellers of fruits, vegetables and other agricultural goods. While Raul Castro opened Cuba's faltering agricultural economy to private enterprise, the government blames a new class of private farmers and produce merchants for a rise in prices.
Mr Machado Ventura has been the public face of a crackdown on what the government labels profiteering.