Intelligence agents discovered that the insurgents were massing weapons at a compound east of the city and ambushed the men when they returned to the site around 1 a.m. to prepare for the attack, said intelligence agency spokesman Latifullah Mashal.
A gunbattle broke out and five of the insurgents blew themselves up with explosives. Police shot and killed the remaining men a few hours after dawn, Mashal said.
The agents found three cars full of explosives and ammunition in the compound, along with rocket launchers and machine guns, Mashal said.
He said the agents believed the men were planning to attack three sections of Kabul - a neighborhood near the parliament building, and areas downtown that house embassies and businesses.
No Afghan forces or civilians were killed in the fighting, Mashal said.
"This was a really big plan. Thank God we were able to stop it," he said.
Taliban spokesman Zabiullah Mujahid rejected the account, saying the Afghan forces had staged the fight as propaganda.
Separately, two NATO service members were killed in a bomb attack in the south Thursday, the international military coalition said. NATO did not provide the nationality of the dead or any details on the bomb blast.
The latest deaths makes six international service members killed in the first two days of August, a particularly deadly start to a month in which fighting typically spikes in Afghanistan.