A tense stand-off developed at the prison
Calm has returned to the main prison in Ivory Coast's commercial capital, Abidjan, after police put down a mass protest, prison authorities have said.
Six prisoners were injured when about 100 police and gendarmes fired machine guns in the air to disperse the crowd.
Others in riot gear worked to gain control of the main prison blocks.
Officials said the protest came after a change in visiting hours, but human rights groups said inmates were upset by overcrowding and poor conditions.
This prison mutiny follows a similar break-out on Friday from a jail in the country's second city, Bouake, during which more than 20 prisoners managed to escape.
Officials denied there was any link between the two disturbances.
The BBC's John James, who was outside the Abidjan Detention and Correction Centre (Maca) on Saturday, says calm has now returned, but for most of the day the sound of machine guns and tear gas grenades could be heard.
After inmates in two blocks revolted, police and gendarmes were sent to the prison to support warders.
A tense stand-off soon developed, with angry prisoners on the roofs hurling stones at the security personnel, who responded by firing tear gas and rubber bullets. Real bullets were also fired into the air above the inmates' heads in a bid to disperse them.
The director of the prison, Patrice Yao, said those responsible for the protest were some of the facility's most dangerous inmates.
After several hours, police managed to secure the area around the prison, while others in riot gear carrying guns and shields regained control of the main prison blocks.
According to the prison authorities, the protest was sparked by a change to visiting hours in order to avoid escapes.
But Drissa Traore, the head of the Ivorian Movement for Human Rights, said the prisoners were also angered by their living conditions.
"You know that this place is overpopulated. The prison is around three or four times the maximum capacity, so the conditions for the prison guards and the prisoners themselves are quite difficult," he told the BBC.
In addition, of the 5,200 people currently detained at the prison, nearly 2,000 are yet to be tried - for some the wait has lasted more than 10 years, our correspondent says.