KABUL, Afghanistan — The seven suspects in the rape of four women had not even gone to trial when President Hamid Karzai assured a visiting delegation of female politicians that he wanted them to be executed — after their convictions, of course.

While he generally opposes the death penalty, Mr. Karzai said, in this case he was ready to make an exception. “I told them to arrest these people, and I expect the chief justice will give them capital punishment,” he said. “And by God’s willingness, we will implement it immediately.”

On Sunday, all seven defendants were convicted and sentenced to death.

The gang rape has transfixed a country that has grown weary of political paralysis in what has turned into a five-month effort to decide who the new president will be. The arrests and prosecution of the suspects in this case has been every bit as fast as the election recount has been slow — and in the view of many foreign observers, just as embarrassing an example of a deeply flawed governing system.

The four women — one of them pregnant, another just 18 and one elderly — were returning, all with their husbands, from a wedding in the Paghman district of Kabul Province, which is a 15-minute drive from the capital, when their cars were stopped by 10 men, some of them dressed in police uniforms and carrying assault weapons. The women were robbed, beaten and raped, then returned to their humiliated husbands.