Police have blamed the deaths on al-Qaida and Taliban inmates held at the grim 1970s-era Pul-e-Charkhi jail on the outskirts of Kabul.
On Tuesday gunfire was again heard from inside the prison as officials said some of the 1300 prisoners were once more smashing windows and beds as they had done when the first revolt erupted last Saturday.
Authorities had been hopeful that earlier talks would end the standoff and had been preparing to move the prisoners to new facilities after their own were damaged in the rioting.
"It seems that they don't respect what they had agreed during negotiations," Mohammad Qasim Hashimzai, Deputy Justice Minister, told AFP. "They've started to break windows and beds and even walls."
He said it appeared some inmates were receiving orders from outside the jail through their mobile phones.
Authorities were trying their best to calm the situation, he said as extra police arrived and a spy drone flew overhead.
"It seems that they don't respect what they had agreed during negotiations"
Mohammad Qasim Hashimzai, Deputy Justice Minister
A prisoner who asked not to be named told AFP by mobile phone that police opened fire late on Tuesday after inmates refused to move to another building.
The man, who said he was being held on criminal charges, said Taliban and al-Qaida prisoners started the revolt and other inmates joined them.
"We're together now and resisting together," the prisoner said. "Unless our demands are met we will not surrender to police."
He added: "The police tried to enter the block but were forced out. We've blocked the gates and windows with beds, chairs and desks."
The prisoner said that their demands included improved living conditions and a review of their cases, but he did not know what the alleged al-Qaida and Taliban detainees wanted.
Trouble began when inmates attacked wardens with makeshift weapons, breaking windows and doors and setting alight bedding and furniture.
Walls separating units for criminals, political prisoners and women were smashed through and police had periodically fired into the building to try to control the prisoners, officials said.
Police blame the riots on
al-Qaida and Taliban prisoners
Troops and security forces surrounded the block for two days and on Monday the army threatened to storm the building if talks failed.
Negotiators had accepted some of the demands, officials said.
These included not making prisoners wear uniforms, a move that was designed to stop escapes during visiting hours but which apparently sparked the initial unrest.
The prisoners then released the women prisoners, many of whom had children with them, and two female guards after the talks on Monday.
They also agreed for the four dead and wounded to be removed from the block.
Police on Tuesday blamed the rioting on a core of 100 al-Qaida and Taliban prisoners in the block's political wing, which held about 300 men.
"What is clear at this stage (is that) some Taliban and al-Qaida prisoners wanted to create chaos and escape," police rapid reaction force commander General Mahboob Amiri told AFP.
Most al-Qaida suspects caught in Afghanistan after the US-led invasion to topple the Taliban regime in late 2001 have been transferred to Guantanamo Bay or the US jail at Bagram Air Base in Afghanistan.
But a number of lower-ranking, foreign al-Qaida militants and some Afghans said to have close ties to the network are still housed in Pul-e-Charkhi, along with rank-and-file Taliban fighters, officials say.
The rundown jail was notorious for the detention and torture of thousands of people during communist rule in the 1980s.