Four suicide bombers and three policemen were killed as a result of a fierce battle in southern Kandahar province, officials said.
A day earlier, security forces surrounded the house in Kandahar City, the provincial capital, where the bombers were believed to be holed up.
Equipped with heavy and light weapons, the militants entered the house in the third police district at 11am, firing three rockets and a hand grenade at security forces.
After a 15-hour battle, the four suicide attackers were killed, the deputy police chief, Col. Rahmatullah Atrafi, told Pajhwok Afghan News at the clash site at 12 noon.
The insurgents were trying to sabotage the voting process in the city, but police delayed the operation to avoid a possible disruption of polling in the area, he said.
Col. Atrafi added police launched the operation at 5pm, evacuating the stranded people before storming the house at midnight. The fighting ended with the killing of the four bombers.
At least three policemen were killed and two others wounded in the clash, which did not harm civilians. At least 24 houses were damaged in the fire exchange.
A resident of the area, Naqib Ahmad, said the attackers had blown up several bombs before entering the residential block.
The attackers took three children hostage but released them in response to an appeal from the local prayer leader on the loudspeaker, he said. Ahmad thanked police for protecting civilians.
Another resident of the area, Hazrat Mohammad, said that they gone through hell and remained awake for 15 hours. “All children, women and others suffered in fear throughout the night.”