The explosion occurred at an administrative building that also housed some military facilities in the Ghani Khel district of Nangarhar province, the governor's spokesman Attaullah Khogyani told AFP.
"The car bomb detonated at the entrance of the district headquarters building. Several armed attackers tried to enter the building after the attack but were killed by security forces," he said.
Provincial police spokesman Farid Khan confirmed the details.
He said most of the victims were Afghan security force members but several civilians were also among the dead.
No one had so far claimed responsibility for the attack but Khan blamed the Taliban.