The seven men, who stood in the dock dressed in brown traditional clothing, were found guilty of kidnapping and attacking the female members of a group that was driving into Kabul 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.
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, dressed in a burqa, told the court.
More From This Section
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 arrested them with police uniforms. They confessed to their crime within two hours of their arrest."
The judge said the seven had the right to appeal against their sentences.