General Abdul Raziq, 39, who has been credited with saving the Taliban's former capital from sliding back into the hands of the resurgent Islamist group, was shot in the back as he left a security meeting with American and Afghan officials.
A gunman wearing an Afghan army uniform opened fired Thursday after a meeting between General Scott Miller and Afghan officials in a southern province.
He said the governor, Zalmay Wesa, was wounded and taken to the hospital.
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.
Mattis said he had not yet spoken to Miller and could not confirm the Taliban's claim of responsibility but believed the attack would not affect Miller's security arrangements or US military movements in Afghanistan.
"Today, I lost a great friend, Lieutenant General Raziq", Miller said on Twitter.
Afghan security forces cordoned off the area as a U.S. military helicopter circled overhead.
In a statement, the Taliban referred to Gen Raziq as a "brutal police chief".
Meghan Markle's Half Sister Breaks Silence On Royal Baby News
Their first official engagement in Dubbo was at the dedication of a new plane for the Royal Flying Doctor Service. The couple reportedly sought medical advice about visiting Tonga and Fiji, where Zika virus has been detected.
The BBC's Secunder Kermani in Kabul says Gen Raziq was a powerful opponent of the Taliban.
More than 50,000 members of Afghanistan's already overstretched security forces are being deployed to protect polling centres on election day.
The attacker was apparently a man wearing the uniform of an Afghan soldier, who opened fire as the officials were in the governor's compound following a security meeting about crucial parliamentary elections on Saturday, officials said.
Raziq, an anti-Taliban strongman, was widely seen as a bulwark against the insurgency in Kandahar, the militant group's birthplace, and had previously survived multiple assassination attempts.
Hundreds of people have been killed or wounded in the months leading up to the long-delayed ballot. The Taliban has threatened to disrupt the voting and has warned Afghans against participating in what the radical Islamist group regards as a pretext for perpetuating US intervention in the country.
Jabar Qahraman, an election candidate in the southern province in Afghanistan, was killed in his campaign office on Wednesday after explosives kept under his sofa blew up.
Raziq narrowly escaped an attack previous year in which five diplomats from the United Arab Emirates were killed in Kandahar.