Two former policemen have been jailed for about 500 years each over a massacre that left 29 people dead in Brazil.

The slaughter outside Rio de Janeiro in 2005 raised fears of death squad activity in the South American country.

Ex-officer Julio Cesar de Paula was sentenced to 480 years in prison and Marcos Siqueira Costa to 543 years for murder and belonging to a criminal organisation.

The length of the sentences was largely symbolic because, under Brazilian law, no one can serve more than 30 years in jail.

The men joined three other former colleagues already sentenced to long jail terms over the mass slayings.

The killings were dubbed the Baixada massacre after Rio’s poor northern outskirts, where prosecutors said a group of policemen fired on pedestrians, bar customers and a crowd in a public square.

Judge Elizabeth Louro, sentencing Paula and Costa, called the killings “crimes, that with their barbarous details, shocked not only the communities where they took place but Brazilian society as a whole”.

Lawyers for the defendants said they would ask for the sentences to be annulled because evidence was improperly presented.

Rio is one of the world’s most violent cities.

Death squads allegedly act as vigilante groups, eliminating criminals and “undesirables”, often at the behest of local merchants.