A Taliban suicide bomber and six gunmen attacked the Afghan parliament on Monday, wounding at least 31 people and sending a plume of black smoke across Kabul, as a second district in two days fell to the Islamist group in the north.
The attack on the symbolic centre of power, one of the most brazen in years, along with a series of Taliban gains elsewhere, raise questions about the Nato-trained Afghan security forces' ability to cope.
"A suicide bomber blew himself up just outside the parliament building and several fighters took positions in a building close to parliament," said Ebadullah Karimi, spokesman for Kabul police.
Afghan security officials said the attackers were unable to enter the parliament itself and two gunmen were reportedly killed on sight.
Sediq Sediqqi, interior ministry spokesman, said the remaining Taliban fighters were fended off by members of the Afghan National Security Forces stationed around the parliament building and fled to a nearby building.
After nearly two hours of fighting, security officials said the Afghan Special Forces were able to kill the remaining gunmen.
A live broadcast showed lawmakers evacuating the building shortly after the car bomb was detonated, around 10.30am local time.
Violence has spiralled in Afghanistan since the departure of most foreign forces at the end of last year as the insurgents push to take territory more than 13 years after the US-led military intervention that toppled the Taliban from power.
The ministry of public health reported 31 civilians, including five women and three children suffered injuries from the attack.
Taliban spokesman Zabihullah Mujahid claimed responsibility.
"We have launched an attack on parliament as there was an important gathering to introduce the country's defence minister," he said by phone.
Monday's attack marked the first major attack by the Taliban since the start of the holy month of Ramadan. The group had denied requests for a ceasefire during the month of fasting.
“The attack against parliament, for which the Taliban have claimed responsibility, is a clear and deliberate affront to democracy in Afghanistan," said Tadamichi Yamamoto, the UN secretary-general's deputy special representative for Afghanistan.
The withdrawal of foreign forces and a reduction in US air strikes have allowed Taliban fighters to launch several major attacks in important Afghan provinces.
The second district to fall to the Taliban on Monday was in the northern province of Kunduz. Officials said it fell after urgently needed reinforcements failed to arrive.
The Taliban captured Dasht-e-Archi district a day after hundreds of militants fought their way to the centre of the adjacent district of Chardara.
"The Taliban managed to take it over this morning as the area has been surrounded for days," Nasruddin Saeedi, the district governor who escaped to the provincial capital, Kunduz city, told Reuters by telephone.
"They are many foreign fighters with heavy machine guns. We have asked for reinforcements, but none arrived."
Afghan soldiers were preparing a counterattack to retake both districts, another local official said.
Monday's heavy fighting was just three km (two miles) from the governor's compound.