KABUL, AFGHANISTAN - SEPTEMBER 7: Seven men who gang-raped four women on August 23, sit in court in Kabul, Afghanistan on September 7, 2014. Afghanistan handed the death penalty to seven men on Sunday for raping and robbing a group of women returning from a wedding in a rare case of sexual assault that has shaken the capital and raised concerns over public security at a time of transition. (Photo by Haroon Sabawoon/Anadolu Agency/Getty Images)

By Hamid Shalizi

KABUL, Sept 7 (Reuters) - Afghanistan handed the death penalty to seven men on Sunday for raping and robbing a group of women returning from a wedding in a rare case of sexual assault that has shaken the capital and raised concerns over public security at a time of transition.

Police said a large group of men, some dressed in police uniforms, and with assault rifles, stopped a convoy of cars in which the women were traveling along with their families in the district of Paghman, just outside Kabul, last month.

They dragged four women out of the cars in the middle of the night and raped them in the field near the main road. One of them was pregnant. The victims were also beaten and their jewelry and mobile phones stolen.

Crimes against women are common but mostly take place inside homes in Afghanistan's conservative society. But a gang rape by armed men is rare in Kabul and has tapped into a vein of anxiety as foreign troops leave the country and a badly stretched Afghan army and police fight a deadly Taliban insurgency.

Judge Safihullah Mujadidi in a summary trial, televised nationwide, convicted the men of armed robbery and sexual assault.

"Based on criminal law these individuals are sentenced to the severest punishment which is death sentence," he said.

The men stood before him in a heavily guarded courtroom. Outside dozens of activists gathered demanding speedy justice to instill public confidence in law and order.

"This kind of gang rape is unprecedented in Kabul," Kabul police chief General Zahir earlier said in his testimony seeking summary punishment for the men.

The assault has led to such outpouring of rage that President Hamid Karzai told a delegation of women last week that the perpetrators would face the death penalty.

The men can appeal Sunday's verdict in a higher court. Karzai has to ratify the executions under Afghan law.

"If this act goes unpunished, the women of Afghanistan will continue to be victims," said Uma Saeed, a rights activist. "This is really very significant moment, I would say, even maybe in the history of Karzai's government." (Writing by Sanjeev Miglani; Editing by Matt Driskill)