Rebellious inmates at a remote Brazilian prison in the Amazon have ended a four-day uprising and released nearly 200 visitors they had taken hostage on Christmas Day.

Officials say the hostages at the Urso Branco penitentiary were released unharmed Wednesday after authorities agreed to some prisoner demands - including the return of gang leader, Ednildo Paula Souza, transferred to another facility following a recent escape attempt.

During the riot, prison officials cut off food, water and electricity supplies at the overcrowded facility, which was meant to hold 350 people but houses at least 950.

In April, the Urso Branco prison was the site of a bloody five-day uprising that left at least 14 inmates dead. Uprisings are a regular occurrence in Brazil's often overcrowded prisons.