The Taliban claimed responsibility for the assault. It is the latest in a series of high-profile attacks by the militant movement as it steps up a campaign of violence to disrupt presidential elections due to be held in a week.
Deputy Interior Minister Mohammed Ayub Solangi said the attackers wore the all-encompassing burqa to sneak unnoticed into a building that looked on to the heavily fortified Independent Election Commission headquarters on the eastern edge of the capital.
None of the dozens of employees and other people who had been hiding inside the election commission headquarters was injured, Solangi said.
The compound is located near the Kabul International Airport. It was shut for more than two hours and flights were diverted out of concern for the safety passengers on planes that must fly low over the site of the standoff to land.
More From This Section
Noor Mohammed Noor, a spokesman for the election commission, said security already had been increased around the compound because an attack had been widely expected. He said the IEC leadership was away when the assault began, and that all IEC staff members were safe.
Taliban spokesman Zabihullah Mujahid claimed responsibility for the attack but described what would have been a much more ambitious assault.
He said a suicide bomber and gunmen had stormed the IEC compound while the IEC and election observers, including foreigners, were holding a meeting.
The Taliban frequently exaggerate in their statements and a meeting could not immediately be confirmed.
Noor denied there was a meeting of observers. A news conference had been planned to discuss election security, but that was canceled, he said.