More than 300 people have been released from a prison in Ecuador where inmates had held them hostage since Sunday.
Several children were among the first to be freed
A spokesman for the prisoners said they had agreed to release the hostages after the Interior Minister, Raul Baca, promised to meet some of their demands.
The inmates are demanding an end to overcrowding and the release of prisoners who have been held beyond the legal limit allowed without a trial.
Mr Baca, announced the government would build three new jails.
Last month, the government declared a state of emergency in the prison system and vowed to ease overcrowding by building new facilities.
In addition to the news jails, which will house 800 inmates, Mr Barca said that more than 1,000 inmates who have been held for over a year without being sentenced would now be released.