The flooding hit the Shakardara and Paghman districts to the north and west of Kabul after the unseasonal rains left knee-deep water across many parts of the war-battered city.
"Twenty people, including several children and a woman, were killed in Shakardara," Ghulam Farooq, an official at the National Disaster Management Authority, told AFP.
"One person was killed in Paghman and more than 20 houses destroyed in Kabul city."
A mosque, several houses, three schools and some crops were also damaged by the torrential downpours which struck yesterday as Afghanistan celebrated Eid to mark the end of the holy month of Ramadan.
But Afghanistan has had one of its hottest summers in decades, and the sudden storms quickly overwhelmed Kabul's poor drainage systems.
Last week flooding in six eastern and southeastern provinces and some districts of the capital killed more than 40 people, destroying hundreds of hectares of farmland and displacing hundreds of people.