Taliban militants attacked a compound operated by security firm G4S

At least 10 people were killed and 19 others injured when Taliban militants attacked a compound operated by security firm G4S in the eastern part of Kabul on Wednesday.

Afghan Public Health Ministry spokesman Wahidullah Majroh said those who were injured were taken to hospitals in the country's capital. 

According to Interior Ministry spokesman Nasrat Rahimi, a suicide car bomb exploded before gunfire broke out at the compound, but it was not clear whether militants or security guards had opened fire.

Rahimi said clearance of the area was not over and that "it will be determined once the operation is over if assailants were involved."

Police had cordoned off the area, and emergency response teams had been deployed to the site of the attack, Rahimi had added.

G4S confirmed the attack on its Twitter account, saying the "situation was ongoing" and that it was working with Afghan forces to end the assault.

G4S is a private risk management company that provides security services to the British Foreign and Commonwealth Office and diplomats in Afghanistan, according to the company website.

The Taliban claimed the attack, with spokesman Zabihullah Mujahid saying that first a truck was detonated, killing dozens of "invaders/hirelings," before multiple Taliban attackers then launched an assault to kill the remaining compound residents.

Wednesday's attack marks the first assault or bombing by the Taliban since July. The militants had in May vowed more attacks on military centres and warned residents to stay away from such facilities in Kabul to "avoid" further civilian casualties. 

According to Mujahid, the attack is in response to recent civilian casualties in southern Helmand and Kandahar, and eastern Nangarhar, caused in operations and airstrikes by Afghan and US forces. 

The militant group reduced its attacks in the capital city after an ambulance bombing on January 21 that killed more than 100 people, mostly civilians, drew a storm of criticism. 

Kabul has seen 21 large-scale attacks this year alone, in which 503 people have died and nearly 970 others have been injured. Together with Wednesday's attack, five has been claimed by the Taliban, with the rest mostly claimed by Islamic State.

At least 50 people were killed last week in the capital when they were targeted by a suicide bomber at a religious gathering.