A high-level meeting to lay out security plans for Afghanistan's upcoming parliamentary elections had just concluded when an elite Afghan guard turned his gun Thursday on the departing delegation in an attack that killed the powerful Kandahar police chief but missed the top U.S. commander in the country, Gen. Scott Miller. The audacious assassination strike, which killed at least one other senior Afghan official and was claimed by the Taliban, underscored the harrowing lack of security in Afghanistan just two days before national elections and more than 17 years after the militant group was driven from power. A Taliban spokesman said Miller was the intended target. However, Army Col. David Butler, who attended the Kandahar meeting with Miller, said the region's powerful police chief, Abdul Raziq, who was killed in the volley of gunfire, was clearly the target, not the U.S. general. 'It was pretty clear he was shooting at Raziq,' Butler told The Associated Press, adding that Miller was nearby but not in the line of fire. The delegates had just gathered for a group photo when gunfire broke out inside the provincial governor's compound in Kandahar City, according to an AP television cameraman who was present when the shooting began. Everyone scattered, and the U.S. participants scrambled toward their nearby helicopter. But a firefight broke out between the U.S. service members and Afghan police when they tried to stop the U.S. delegation from reaching their helicopter, said the cameraman. Besides Raziq, Kandahar's intelligence chief, Abdul Mohmin was killed in the attack, according to deputy provincial governor Agha Lala Dastageri. He said Kandahar Gov. Zalmay Wesa also died of his wounds after being taken to a local hospital, although security officials in the capital maintained Wesa was wounded but survived. Three Americans — a U.S. service member, a coalition contractor and an American civilian — were injured and in stable condition, said NATO spokesman U.S. Col. Knut Peters. Taliban spokesman Qari Yousuf Ahmadi said the militant group carried out the attack, and Gen. Miller was the target. Butler disputed that, saying the assailant shot at Raziq and then appeared to spray the area with gunfire before he was killed. He said Miller and the Afghan leaders had moved outside the palace after several hours of meetings and were standing in small groups in the compound. He said he heard several shots 'and we all took cover. It was over in seconds.' 'We stabilized and treated the wounded and secured the area,' said Butler, adding that Miller made sure the scene was secure and the wounded were taken away by medivac before he left the area and returned to Kabul. Razik was a particularly powerful figure in southern Kandahar and a close U.S. ally despite widespread allegations of corruption. He ruled in Kandahar, the former Taliban heartland, with an iron fist and had survived several attempts to kill him, including one last year that resulted in the death of five diplomats from the United Arab Emirates. Raziq's killing 'may have major implications on the security situation in southern Afghanistan. As the chief of police in Kandahar, he has kept a lid on the Taliban's insurgency, which has intensified over the past several years,' analyst Bill Roggio wrote in the Long War Journal. The Taliban have vowed to disrupt Saturday's parliamentary elections, warning teachers and students not to allow schools to be used for polling and warning Afghans to stay away from the polls. Within hours of the attack, Afghan President Ashraf Ghani addressed the nation to assure Kandahar residents it was safe to go to the polls. In an AP interview, his adviser, Ziaulhaq Amarkhil said the attack was meant to disrupt elections and urged voters to defy Taliban threats, saying casting their ballot 'would be a big slap on the face of the enemy.' At a news conference in the Afghan capital, Afghanistan's Army Chief Gen. Mohammad Sharif Yaftali said additional troops had been moved from neighboring Helmand province to Kandahar. Pakistan's new prime minister, Imran Khan, and its military chief condemned the assault. 'The people and the security forces of Afghanistan have been paying a heavy price due to continued instability and threats from the enemies of peace,' Khan said in a statement. 'Pakistan stands by the government and the people of Afghanistan in their quest for lasting peace and stability.' Security has been steadily deteriorating in Afghanistan with increasingly brazen attacks being carried out by insurgents and Afghanistan's security forces have been on high alert ahead of Saturday's elections. Late Wednesday, a NATO convoy was attacked near the Afghan capital, killing two civilians and injuring five Czech troops, Afghan officials and the Czech military said Thursday. The attack in the Bagram district of Parwan province, also wounded three Afghan civilians, said Wahida Shakar, spokeswoman for the provincial governor. The Taliban claimed responsibility for the attack in Bagram, which is the home of a sprawling U.S. military base. In recent months, Afghan troops have come under near-daily attacks. NATO troops, which handed over security to Afghan forces at the end of 2014, mostly train and assist with air power. So far this year, eight U.S. soldiers and three other NATO service members have died in Afghanistan. ___ Associated Press writers Lolita Baldor in Washington and Karel Janicek in Prague contributed to this report.