(CNN) - The powerful police chief of Kandahar province in Afghanistan was killed Thursday in an attack following a security meeting with the top US commander in the city, three Afghan officials told CNN.

Two Americans also were wounded in the shooting attack at Kandahar Palace, said Col. Dave Butler, a spokesman for US Forces-Afghanistan. US Army Gen. Scott Miller, the commander of US and NATO forces in Afghanistan, was present but uninjured in the attack, a statement from US forces said.

While Butler initially said three Americans were wounded, he later issued a statement clarifying that the three wounded personnel were all members of the NATO-led coalition but only two of the wounded were Americans.

The police chief, Gen. Abdul Raziq Achakzai, was one of the most prominent security figures in Afghanistan. The Taliban released a statement claiming responsibility saying they killed "the notorious police chief" who was their primary target in the attack.

US Defense Secretary told reporters that he had met Raziq previously and called his death "the loss of a patriot."

Miller offered similar praise in a statement provided by the NATO-led coalition.

"Today I lost a great friend LTG Raziq. We had served together for many years. Afghanistan lost a patriot, my condolences to the people of Afghanistan," Miller said.

"The good he did for Afghanistan and the Afghan people cannot be undone," Miller added.

The shooter was killed by the US military, one official said. The Americans wounded in the attack included one US service member, a coalition contractor and one US civilian government employee, according to two US military officials. They were evacuated and are in stable condition.

All of those shot were in close proximity to Miller, one official said, adding that the US assesses that Raziq was the target because the shooter had the first choice of shot and went for Afghans, not Miller.

Afghanistan's President Ashraf Ghani confirmed later Thursday that the chief of police and the Kandahar director of Afghanistan's intelligence service, the National Directorate of Security, were killed in the attack.

"My condolences with Afghan people specially people of Kandahar," Ghani said, saying he had ordered Afghan security officials to investigate the incident.

While Kandahar has been one of the more relatively stable provinces in Afghanistan, the high-profile insider attack and assassination of a key American ally raises questions about the region's future stability as the Afghan government readies for this month's parliamentary elections.

"We remain absolutely committed to an Afghan led Afghan reconciliation. We need to find who has done this. But right now ... we are going toward the election and we will continue to defend the Afghan people," Mattis said.

This story has been updated to reflect new information from US authorities.