An Afghan judge has sentenced seven men to death for the gang-rape of four women in a case that has sparked nationwide outrage, with angry protests outside the court and proceedings broadcast live on television.

The men were all found guilty on Sunday of kidnapping and attacking the female members of a group that was driving into Kabul, the capital, from a wedding.

In a trial that lasted only a few hours, the death sentences were technically handed down for the crime of armed robbery.

President Hamid Karzai had earlier called for the men to be hanged.

The court heard the men, wearing police uniforms and armed with guns, had stopped a convoy of cars in the early hours of August 23.

They dragged the four women out of the vehicles, robbed them, beat them up and then raped them. One of the victims was reported to be pregnant.

"We went to Paghman with our families. On the way back, they took us, one of them put his gun on my head, the other one took all our jewellery, and the rest started what you already know," one victim told the court.

Death calls

As noisy demonstrators outside the court demanded the death penalty, applause erupted inside after Kabul police chief Zahir Zahir also called for the men to be hanged.

"We want them to be hanged in public, so that it will be a lesson for others," he said. "We arrested them with police uniforms. They confessed to their crime within two hours of their arrest."

RELATED: Afghan women face increasing abuse

The judge said the seven had the right to appeal against their sentences.

Al Jazeera's Jennifer Glasse, reporting from Kabul, said: "It [Afghanistan] is such a conservative society. Normally any kind of cases like this are kept very quiet. It was a local hospital that notified the police.

"The men do have the right to appeal. But the public opinion is, very much against them.

"Demonstrations across four provinces in the last couple of days have called for swift and open justice in this case that has outraged Afghans.

"Three other men are at still large and police is promising to bring them to trial as well."