INMATES at a maximum-security prison in northeast Brazil, who had taken four guards and more than 100 visiting relatives hostage during a riot, released all the captives Sunday, officials said.
Negotiators secured the remaining hostages' release just hours after first persuading prisoners to give up one of the guards they had seized in the riot, which broke out Saturday at the end of visiting hours at the Advogado Jacinto Filho prison in Aracaju, the capital of Sergipe state.
"The rebellion is over. The guards and all the prisoners' relatives who were inside have been freed," Marinho Tibas, a spokesman for the state justice department, told AFP.
He said 127 visiting family members, including 15 children, had been held hostage, raising an earlier count of 118 relatives.
"Everything is returning to normal," Tibas said, calling the negotiations intense but "calm."
The freed hostages have undergone medical checks, he said.
Media reports said the first guard to be freed was wounded.
During the riot, inmates also killed a police dog used to search for contraband, officials said.
Under the deal reached with the hostage-takers, 16 inmates will be transferred to other prisons, officials said.
The rioters were recently sentenced inmates who had been temporarily jailed at the facility and were demanding to be transferred.
As a maximum-security prison, the facility does not allow food from outside, strictly limits outdoors time and prohibits cell phones.
The riot broke out 26 days before the opening match of the World Cup in Brazil, which has faced protests over the more than $11 billion being spent on the tournament and a series of strikes that threaten to disrupt it, including by police.
No World Cup games will be played in Sergipe, however.
The riot erupted in one of the prison's four wings and involved 123 prisoners, officials said. Talks to free the hostages began Saturday but broke off overnight.
The negotiation were led by a military police captain, said Sandra Melo, a lawyer for Reviver, a private firm that co-manages the prison with Sergipe state. She said a judge and representatives of the state human rights commission were are also present at the prisoners' request.
The prison holds 476 inmates and has not faced complaints of overcrowding.
Police contained the riot before it could spread to the prison's other three wings, reports said.
The head of military police in the state, Mauricio Iunes, told the G1 news website Saturday that the four prison guards had been "threatened" but that officials never believed the prisoners would hurt their own relatives.
A similar riot broke out two years ago at the same prison and was resolved after 26 hours.
In Brazil there are currently 548,000 people in prison -- and a need for 207,000 more spots to prevent overcrowding, according to Conectas, an organization specializing in inmate rights.
Late last month, six prisoners died and six were wounded in a riot at a prison in the state of Bahia, which borders Sergipe to the south.