Deputy Justice Minister Mohammed Qasim Hashimzai said more than 1,300 unruly inmates at Policharki prison, including the 350 Taliban and al Qaeda loyalists, were transferred to another block of the prison under official guard. As they cleared out, one more prisoner was found dead, he said.
At least 40 prisoners were reported injured in the revolt, officials said.
"God help us, now everything is safe and secure," Hashimzai told reporters.
Hashimzai said American inmate Edward Caraballo, who had earlier called media to say other prisoners had threatened to cut his head off, was safe.
Afghan soldiers escorted reporters to look inside the prison on the outskirts of the Afghan capital.
Block Two, where the rioting by hundreds of inmates broke out late Saturday, was dark and empty, but flashlights showed its walls scarred with bullet holes inside and out. There was a burnt smell from where prisoners had set fire to bedding and furniture.
Women inmates could be seen looking out of small cell windows from a separate, nearby block. There are about 70 women inmates and another 70 children living with them in the prison. Gen. Mahboob Ullah Amiri, commander of a rapid reaction force at the prison, said none of the women prisoners had been hurt, although their section of the jail had been infiltrated by rioters.
He said the riot had been led by a former senior Taliban commander, Mullah Mujahed. About 100 Taliban and al Qaeda inmates considered dangerous were now in separate rooms from other prisoners and under tight security, he added.
Hundreds of inmates began rioting late Saturday, reportedly after refusing new prison uniforms that were being introduced after some Taliban inmates escaped last month by disguising themselves as visitors.
Security forces had surrounded the prison to prevent escapes as government officials tried to negotiate with the rebellious inmates.
There was a fresh outbreak of violence on Tuesday, when police opened fire on inmates trying to push down a gate, killing one and injuring three.
But early Wednesday, authorities reported progress in resolving the standoff, saying hundreds of prisoners were in the process of being transferred from Block Two, where the rioting began. Hashimzai said the transfers were complete by early evening.