Two dissident candidates have conceded defeat in Cuban local elections that offered them a chance to become the first officials elected from outside the Communist Party in 40 years.

Hildebrando Chaviano and Yuniel Lopez had been chosen as candidates by a show of hands in Havana area nominating meetings and hoped to win two of the 12,589 seats at stake in 168 municipal councils.

But both acknowledged they had no chance of victory after preliminary results showed Mr Chaviano in last place of four candidates and one of Mr Lopez's pro-government opponents with twice his vote.

Mr Chaviano, 65, is a former government lawyer who is now an independent journalist and Mr Lopez, 26, is an unemployed member of a dissident political party.

Cuba's former president Fidel Castro was among thousands who cast their votes.

A win by either of the dissidents would have been symbolically significant.

Outside observers said the fact they made it past a first round of show-of-hands voting at the neighbourhood level reflected a government desire to show at least the appearance of softening its control of the political system following presidents Barack Obama and Raul Castro's historic announcement last year that they were declaring detente after 50 years of Cold War enmity.

The dissidents and foreign press watched the vote-counting without incident, although Mr Lopez complained that he had not been able to watch the full count in one polling place.

He also said that government backers had pressured people in his neighbourhood to vote against him.

Cuba's municipal elections allow direct voting for delegates to municipal assemblies that deal with local issues like sewers and street repairs.

The government controls the nomination and selection of candidates for higher-level bodies including the national assembly, which at least nominally chooses top national officials.

"The vote was clean," Mr Chaviano said. "The people don't want change."

The count of Mr Chaviano's race in Havana's relatively upmarket Vedado area was watched by an unusual number of residents, virtually all in favour of pro-government candidates.

After the vote count was read out, they assembled into a well-organised crowd that shouted pro-revolutionary slogans including "Love live Fidel!" after former president Fidel Castro.

Narciso Viera, a 71-year-old retired manual labourer, told an American reporter that he voted against Mr Chaviano because "he's a counter-revolutionary, in the pay of your government for many years".

Mr Chaviano's government-edited official candidate biography described him as a counter-revolutionary, and mentioned that he had taken classes at the US Interests Section in Havana. Mr Lopez's biography contained similar disparaging information.

Backers of Julio Cesar Chaldran, who beat Mr Lopez, marched through their working-class area of Arroyo Naranjo singing the national anthem and shouting "Long Live the Revolution".

A group of Mr Lopez's backers marched alongside shouting back their support for the dissident.

"I'm very happy, despite the defeat, to see people supporting me, despite the campaign against me," Mr Lopez said.