RIO DE JANEIRO (Reuters) - Prisoners who rioted in an overcrowded Rio de Janeiro prison and took 18 hostages have released all the captives and the facility is under the control of guards, authorities said Monday.

Eight guards and 10 inmates had been taken hostage during the riot that began Sunday afternoon, the Rio state penitentiary administration said in a statement. They were freed early Monday. There was no word on injuries.

The incident was the latest in a string of deadly uprisings in Brazil’s prisons, which experience endemic violence and are under the de facto control of powerful drug gangs.

Rights groups call prison conditions medieval, with food scarce and cells often so packed that inmates have no space to lie down.

Earlier on Sunday, Rio state authorities said they would make changes to increase prison security, although details were not disclosed. The changes are part of the federal government’s intervention in Rio state’s security system.

On Friday, President Michel Temer ordered the military to take control of Rio state’s police force and its prisons, a decree that Congress must approve, which it is expected to do this week.