Earlier reports claimed that between 12 and 15 soldiers were killed in the attack on an Afghan military base in Maidan Wardak province just outside the capital Kabul.
Most killed are people from the security forces. The attack was aimed at a military camp and a local police training center.
An Interior Ministry spokesman, Nasrat Rahimi, said the attack began with a suicide bomb followed by the rebels opening fire on Afghan forces.
At least two members of the Taliban will have been killed by Afghan soldiers.
Several of the injured were severely injured and sent to hospital in Kabul, official Salem Asgherkhail told the local health authorities.
The Taliban is making almost daily attacks in Afghanistan, and the rebels are massively present in nearly half of the country.