Heavily armed soldiers surrounded Afghanistan's main high security prison last night, after Taliban and al-Qaida inmates led a revolt that left at least 30 people wounded and possibly several dead.

At least 1,500 prisoners barricaded themselves into the two main wings of Pul-i-Charki prison on the eastern outskirts of Kabul after a riot erupted on Saturday night over new uniform regulations. Bursts of gunfire and cries of "Allahu Akbar!" - "God is most great!" - were heard from inside the prison, a cramped Soviet-era facility that many Afghans associated with torture. Smoke rose into the air, apparently from burning mattresses. By evening hundreds of Afghan soldiers backed by rocket launchers and at least 10 tanks moved into position to prevent a mass jailbreak after negotiators failed to end the siege.

"The prisoners have no unity and have different demands. There's no one leader who can talk to us," said the deputy justice minister, Muhammad Qasim Hashimzai, at dusk before leaving. Negotiations are due to resume this morning. The minister blamed the prison's 350 Taliban and al-Qaida inmates for sparking the uprising. He denied reports that seven inmates, including two Taliban, had died but confirmed 30 injuries. Nato peacekeepers and US soldiers at the scene did not intervene but a western diplomat, who had received a military briefing on the crisis, said they would act in the event of a jailbreak.

"If you had hundreds of dangerous prisoners fleeing into town after dark, I don't think Isaf [the Nato-led force] would allow that to happen," he said on condition of anonymity. The siege started on Saturday night when prisoners in the main block, which houses 1,300 inmates, apparently revolted against an instruction to wear blue uniforms. The uniforms were deemed necessary to prevent a repetition of last month's jailbreak when seven Taliban prisoners walked free during visiting hours. Ten prison guards accused of helping them were arrested.

The prisoners barricaded themselves into the women's wing, taking at least two guards hostage and brandishing crude weapons fashioned from broken furniture. An unnamed official told the Associated Press that the prisoners had dug a tunnel into the women's wing. By yesterday evening the violence had spread to an adjoining blocking housing 750 prisoners, who burned furniture, mattresses and bed sheets. Some attempted to scale the prison walls.

The prisoners refused to hand the 30 injured people over to the International Red Cross for treatment, said Mr Hashimzai. "We have surrounded the jail. There's no way to escape," he said. The incident is another embarrassment for the Afghan government, which is struggling to contain a surge in Taliban attacks in the south. One security official estimated that 1,500 prisoners were involved but many details, including the identity of the ringleaders, were unclear. "The Afghans say it is Taliban but then again they call everyone they don't like Taliban. So it's hard to know," said the western diplomat.

A crumbling and overcrowded facility, Pul-i-Charki has a dark reputation among Afghans. Thousands of opponents of the communists were tortured to death there in the 1980s and it was the scene of many Taliban executions in the 1990s. Today the prison houses inmates from petty thieves to Taliban fighters, and security is notoriously weak. In December 2004 Afghan soldiers stormed the prison to break a bloody siege by al-Qaida suspects that left four guards and four inmates dead.

International aid was used recently to renovate parts of the prison to improve living conditions and security. Some 110 Afghan prisoners are due to be transferred there from Guantánamo Bay this year.