"The police chief, General Raziq, and the provincial intelligence chief, General Abdul Momin, were killed".
Six of Raziq's bodyguards and two intelligence officers also were wounded in the attack that was carried out by one of the governor's security personnel, the official said.
General Miller was safely evacuated form the area after the incident, North Atlantic Treaty Organisation said.
In an interview with AFP a year ago, Raziq said the Taliban had targeted him "countless times", adding he could remember 20 of the incidents, including at least eight suicide attacks.
"He was the one guaranteeing security in Kandahar", said a foreign diplomat in Kabul.
Afghan officials said the assault began as attendees were leaving the complex.
It is too soon to say if a major attack in Afghanistan that killed a top security commander will hurt voter turnout in Saturday's elections, U.S. Defense Secretary Jim Mattis said, but added that the U.S. military's mission was unaltered.
He rose through the police ranks after the USA -led invasion of 2001 that ousted the Taliban, serving for a time as commander of the protection force along Kandahar province's sensitive southern border with Pakistan.
Gen. Abdul Raziq and provincial NDS chief Gen. Mubin Hassankhail dead and few other senior officials wounded. Ahmadi asserted that Miller had been killed, a claim denied by US military officials. They were killed by explosives hidden in a government building, in Kandahar.
He had been a key figure in the United States strategy of securing the southern region against the Taliban. "Gen. Miller uninjured, attacker reportedly dead", tweeted the official account of Resolute Support, the North Atlantic Treaty Organisation mission in the country.
The recent attack is a blow to the Afghan government as it gears up for parliamentary elections on Saturday, which the Taliban have vowed to disrupt.
Security forces swarmed the southern city of Kandahar after the shooting that shuttered shops and sent terrified civilians - already on high alert for attacks - into their homes. Two Americans were injured in the incident at the compound, a North Atlantic Treaty Organisation spokesperson said, and a local cameraman was reportedly killed.
Violence has increased ahead of the long-delayed vote, with hundreds of people killed or wounded in poll-related attacks across the country. The Taliban also attacked checkpoints in the northern Baghlan province, killing six policemen and wounding two others in a four-hour battle.
The gunman, reported to be a security guard, opened fire as officials left a meeting in Kandahar province.
Eight US soldiers and three other North Atlantic Treaty Organisation service members have died in Afghanistan so far this year.