A suicide bomber and several gunmen staged a brazen attack on the Afghan parliament on June 22, killing two civilians in an assault claimed by the Taliban, while in the north a second district in two days fell to the militants.
Police said later that the attackers had been killed and all lawmakers were safe, but the large-scale assault on parliament and the loss of ground in the north underscored the challenges posed by Taliban militants following the departure of most foreign forces at the end of last year.
The attack came as President Ashraf Ghani's nominee for defense minister -- a post that has been vacant since he took office in September amid infighting after a disputed election -- was to be introduced to lawmakers.
Video footage showed dust and debris filling the parliament chamber as the camera shook violently following the initial blast, which Afghan authorities said killed a woman and a child outside the building.
Police said that seven militants were involved in the attack and that all of them were killed.
"One detonated a car… and six others were killed by security forces after they entered a nearby building," the Interior Ministry said.
Officials said that all the lawmakers were safe, but that 31 civilians were wounded.
A correspondent for RFE/RL's Radio Free Afghanistan said security was unusually lax around the parliament building on the morning of June 22, before the attack took place.
WATCH: Video captures moment when car bomb detonates outside parliament
Ghani condemned the attack "in the strongest possible terms," saying in a statement that targeting innocent people in the Muslim holy month of Ramadan "is a clear act of hostility against the religion of Islam and that the perpetrators are criminals who are bound by no creed or religion."
The U.S. Embassy in Kabul also strongly condemned the attack, which it said showed "blatant disrespect for democracy and the rule of law," and offered its sympathies to the Afghan people and parliament deputies.
In Brussels, NATO Secretary-General Jens Stoltenberg called it "an attack on democracy," and said: "The Afghan forces stand their ground. They and Afghan people deserve our full support."
Taliban spokesman Zabihullah Mujahid swiftly claimed responsibility.
"We have launched an attack on parliament as there was an important gathering to introduce the country's defense minister," Mujahid said by phone.
Ghani nominated Masoom Stanekzai, a top official in the government body overseeing the country's peace process, for the job on May 21.
Despite several previous nominations, the post has remained vacant amid disagreements between Ghani and his chief rival in last year's disputed election, Abdullah Abdullah, who became Afghanistan's chief executive officer under a power-sharing deal. The delay has sparked widespread criticism.
Stanekzai was expected to be confirmed by parliament.
A vehicle is seen on fire after a blast near the Afghan parliament
He is a rival of Abdullah's political faction. Stanekzai's nomination was sharply criticized last month by Abdullah ally Atta Mohammad Noor, governor of the northern Balkh Province, who has accused him of involvement in the killing of former Afghan President Burhanuddin Rabbani in 2011.
Lawmaker Amir Khan Yar told RFE/RL that parliament members left the building after the initial blast and that none of them was hurt.
"We heard the explosion right behind the wall of the parliament building and lawmakers left the hall," Yar said.
"The explosion shook the hall and the room. We heard two explosions. The first one took place when we were inside, and we heard the second explosion from a distance when we were outside."
Some eyewitnesses told RFE/RL that they heard up to 10 explosions in the area.
Hundreds of children were evacuated from a nearby school.
The Taliban has launched attacks on government building and other targets in the past.
Violence has increased since most foreign military forces left last year, with the Taliban in a new push to take territory more than 13 years after the U.S.-led military intervention that drove them from power following the September 11, 2001, terror attacks in the United States.
Following the withdrawal and a reduction in U.S. air strikes, Taliban fighters have launched several major attacks in key Afghan provinces.
Stoltenberg said in Brussels that NATO "will continue to support [Afghanistan] and we have decided to continue with a long-term partnership and therefore NATO is going to be there and to help Afghans with protecting themselves and protecting Afghanistan as a democratic and unified country."
Also on June 22, the Taliban captured Dasht-e-Archi district in the northern Kunduz province, a day after hundreds of militants fought their way to the center of the adjacent district of Chardara.
With reporting by Reuters, AFP, and AP