SAO PAULO, brazil (AP) _ Hundreds of inmates at a prison in eastern Brazil have ended their rebellion and released their 23 hostages unharmed, police said today.

The uprising at the prison in Unai, 500 miles north of Sao Paulo, began Sunday afternoon when the prison's 317 inmates seized seven guards and 16 visitors, Unai policewoman Silvani Fonseca said in a telephone interview.

The rebellion ended when law enforcement officials agreed to transfer ``as many prisoners as possible to other facilities nearer their families,'' Fonseca said.

During more than 30 hours of tense negotiations, the prisoners set fire to mattresses and threatened to kill the hostages.

Overcrowding, a chronic problem in Brazil's penal system, was not a factor in the uprising, Fonseca said.

``Besides the transfers they also made absurd demands like air conditioned cells, cellular telephones and cable TV, which of course were turned down.'' she said.