Fidel Castro at Cuba congress alongside Raul
Former Cuban President Fidel Castro has made an unannounced appearance at a Communist Party Congress alongside his brother, current President Raul Castro.
The two men received an emotional standing ovation from delegates in the Cuban capital, Havana.
It is the first time the two have appeared publicly together since Fidel, 84, handed over the presidency to Raul five years ago.
Congress also elected Raul, 79, to take over from Fidel as first secretary.
Communist Party stalwart Jose Ramon Machado Ventura, 80, was elected second secretary.
The BBC's Michael Voss in Havana says Fidel's appearance is a sign of his support for the economic changes his brother has been pushing through.
But it could also be the revolutionary leader's final farewell to the political stage, he adds.
Earlier, the congress decided to allow Cubans to buy and sell their homes for the first time since the communist revolution in 1959.
For the past 50 years, Cubans have only been allowed to pass on homes to their children, or to swap them through a complicated and often corrupt system.
Correspondents at the closing stages of the congress said many delegates were in tears as Fidel was helped to his place on stage and stood for the national anthem.
The former president appeared unsteady on his feet as he clutched an aide's arm, and at times slumped into his chair.
The congress was the first held by the ruling party in 14 years and was aimed at breathing new life into the communist system.
Raul Castro also told delegates that top political positions should be limited to two five-year terms, and promised "systematic rejuvenation" of the government.
He said the party leadership was in need of renewal and should subject itself to severe self-criticism.
Analysts say the proposal is unprecedented under Cuban communism.
The party's new central committee - appointed on Monday - has also been trimmed down from 19 to 15 and includes three new members.
President Castro has spoken of the need to bring through younger leaders to take over once the ageing generation which led the revolution has gone.