At least a dozen Afghan security forces officials were killed when a suicide attacker driving an explosives-packed Humvee blew himself up in the southern province of Kandahar, police said on Thursday.

The Taliban claimed the deadly assault on the government and police headquarters in Maroof district that also wounded several others.

“Twelve security officials were killed and four others were wounded,” Kandahar police spokesman Zia Durrani told AFP.

Durrani said that the Taliban attackers had been “defeated”.

A border police commander in Maroof, which borders Pakistan, gave a slightly higher toll, telling AFP that 14 security personnel had been killed and eight wounded in the attack that happened late on Wednesday.

“The intensity of the blast caused damage to the building and led to casualties,” he said. “The clean-up operation is under way in the area.”

The attack is the latest deadly assault by the Taliban, which has been on the offensive since United States (US)-led Nato combat troops withdrew in 2014 and now controls swathes of territory across the country.

Insurgents launched a volley of rockets near Kabul's international airport, during a high-profile visit by the US Defense Secretary Jim Mattis and Nato chief Jens Stoltenberg to the Afghan capital on Wednesday.

A US airstrike launched in support of Afghan security forces who had confronted the attackers caused “several casualties” when a missile malfunctioned.

One person was killed and 11 others wounded in the assault that lasted several hours, according to the interior ministry.