At least five inmates died and another eight were injured during a riot in the Eunapolis prison in Brazil's Bahia state, authorities reported.

The deaths were attributed to a dispute between two gangs of prisoners who allegedly took advantage of the confusion generated by the riot to attack their rivals, said the Public Safety Secretariat in the northeastern state, the capital of which is Salvador.

The riot began about 9 a.m. (1200 GMT) when prison guards announced a surprise inspection of the cells and ended around 5 p.m. (2000 GMT) when authorities managed to bring the situation under control with the help of the Militarized Police.

Shortly after the announcement of the surprise inspection, prisoners took control of one of the cell blocks and set fire to mattresses and other objects in the prison yard.

Some 350 prisoners participated in the riot, according to Maj. Cleber da Silva, the commander of the 7th Independent Company of Militarized Police in Bahia.

The bodies of the murdered inmates were found by the police during their operation to regain control of the prison.

Two of the injured were transported to the main hospital in Eunapolis with shrapnel wounds in their legs apparently caused by a homemade bomb.

Authorities said that the prisoners presented no demands and did not explain their reasons for the riot. EFE