Rebel inmates who seized control of Guatemala's largest prison agreed Thursday to end their 5-day-old uprising, a government negotiator said.

"We have an agreement in principle," Gonzalo Menendez de la Riva, the head government negotiator told reporters when he emerged from a morning meeting with the rebels.Menendez, the special attorney general for human rights, said he would take the accord to the capital, 15 miles west of the prison, for the signature of Interior Minister Roberto Valle Valdizan, then return to the prison.

He said he expected the agreement would be signed by both sides Thursday.

Red Cross officials were reportedly preparing to evacuate the civilians inside the prison once the accord was signed.

The government offered late Wednesday to replace the warden and all the guards at the 1,350-inmate Pavon prison farm if the rebels surrendered.

Between 75 and 100 rebel inmates armed with M-1 rifles have been in control of the prison, Guatemala's largest, since Sunday. At least four guards and three inmates died in the Easter revolt.

About 600 people - mostly women and children - were visiting when the uprising began. Some stayed inside with the inmates, and authorities differed on whether they were hostages or whether they stayed to protect their loved ones from security force reprisals.

The government said it would consider the rebels' request for pardons for crimes committed during the uprising and guarantee their physical safety once they surrendered their arms and the roughly 500 people with them.

About 110 prisoners who took no part in the revolt fled Wednesday from the section that remained under inmate control and were taken into custody.

Twenty relatives of inmates trapped inside when the uprising began also made their way out.

In its Wednesday offer, the government also promised to promote "strict application" of a law providing for reduction of sentences through work and present to Congress the mutineers' demand for a nationwide reduction of all prison sentences by five years.

Any pardon or amnesty for crimes committed during the rebellion would have to be enacted by Congress.