General Raziq was the third of the last four Kandahar police chiefs to be killed on the job.

Mr. Smith said he had brought a measure of calm to a city that was experiencing daily explosions when he took command of the province’s police force in 2011. But his methods, he said, often involved “a savage campaign” against the Taliban, tactics that were celebrated in the city but terrified people in the countryside.

General Raziq was 17 when he picked up a gun, and for years he was known to boast about Taliban body counts. But he mellowed in recent years, the war visibly changing him.

“I was a young man and then thought it was a good thing,” General Raziq said in an interview in 2015. “But I have come to despise it. I have come to realize this can’t be done through death and blood.”

Initially, there were conflicting reports about whether the Kandahar governor, Zalmai Wesa, and Gen. Nabi Elham, a police commander responsible for several provinces, had survived the attack. General Ibrahimi said both “are wounded but are under medical operation,” but other officials, including one of Mr. Wesa’s deputies, Agha Lalay Datagiri, said the governor had been killed. Other officials said the police commander had been injured.

In a brief televised message, President Ashraf Ghani said he had dispatched his intelligence chief and other senior officials to Kandahar to investigate the shootings. “I promise the Afghan people that soon the situation will get normal in Kandahar,” Mr. Ghani said.

The loss of General Raziq casts a further shadow on a political season already marred by bloodshed. One-third of polling stations will not open because of security concerns, and at least 10 candidates and dozens of their supporters have been killed. The Taliban have threatened to attack polling places.