Rio de Janeiro: Brazilians are up in arms over the ordeal of a black man jailed for more than a week in Rio because he was mistaken for a suspect who was also an Afro-Brazilian with a shaven head.

“It does not change, and it will never change. Society is racist and it will always be,” Antonio Carlos Rodrigues told local media when he was released from jail late Friday.

The story might seem a bit different in a less diverse society; but more than half of Brazilians are black or mixed race.

Police in Rio de Janeiro said they have opened an investigation “to establish the responsibilities” in this case.

The 43-year-old worker was arrested on July 13, accused of taking part in an armed robbery at the Venezuelan consulate.

To identify him, police compared video surveillance images from the consulate to photos the man had put on social networks.

In those images the suspect was wearing sunglasses.

According to a report published by the G1 site, the commissioner in charge of the investigation saw a resemblance in “skin colour, the shape of the nose and face,” and highlighted certain features such as bald head and “large, pointed ears.”

“It’s a massive mistake, anyone can recognise the physical differences between the two,” Rodrigues’ brother told the G1 news site.

The family of the detainee carried out its own investigation and got other images from security cameras. It turned out the suspect who appears in the consulate video was already in prison.

He had been arrested a few days later for another assault with an armed weapon.

Police finally acknowledged their error and gave the order to free Rodrigues.

Many Brazilians have signed on to a social media campaign called #Somos todos Antonio Carlos (We are all Antonio Carlos).

Brazil was the last country in Latin America to end slavery in 1888, and even now, acts of institutional racism deepen social inequalities.

While most Brazilians are black or mixed race, for example, data show that only five per cent hold managerial positions.