Police Superintendent Agrimero Cruz Junior said the armed inmates wanted to hold talks with two prominent Muslim personalities - movie actor and Muslim convert Robin Padilla and southern Philippines Muslim legislator Mujib Hataman.
Hataman negotiated with the suspects by telephone and announced that they had come to an agreement.
Two inmates were to address the media, and the others were then to emerge, he added.
"There was some delay because they feared for their safety," said Avelino Razon, police chief for the metropolitan Manila area. "But they changed their minds and they've agreed to come out."
"There was some delay because they feared for their safety"
Avelino Razon, police chief for Manila metropolitan area
The prisoners had also demanded speedy trials, the right to air their grievances to the authorities and assurances they would not be harmed if they surrendered, he said.
At least three guards were killed, said police Cruz. Two alleged Abu Sayyaf members also were killed, police said.
Police spokesman Leopoldo Bataoil, who had warned of a major assault if the inmates did not give up their weapons, said about 10 men were involved in the uprising, led by Alhamzer Manatad Limbong and Kair Abdul Gapar.
A spokesman for the suspects, detainee Hazdi Daie, said in a telephone interview that if police stormed the building, "then you will hear bombings all over Manila".
Police had initially threatened
to storm the building
The drama began when a suspected Abu Sayyaf member, who was about to be escorted to a morning court hearing, overpowered a guard before he could be handcuffed, took a rifle and shot the prison officers around him, police officials said. Other inmates then grabbed weapons.
Three guards were killed and three other prison officials were wounded and taken to a hospital, police said.
It was not clear if hostages were held, Cruz said.
But Daie, the inmates' spokesman, told DZBB radio the suspects had held about 100 hostages.
State prosecutor Peter Medalle, who is handling several cases involving the Abu Sayyaf, told reporters that prison guards were tipped off about a possible prison break three weeks ago because of an intercepted mobile phone conversation between Limbong and Abu Sayyaf leader Abu Solaiman.