At least 26 children were among the wounded, many of whom were cut by shards of glass when the bomb shattered nearby windows, government spokesman Feroz Bashari said. He said a total of 105 people were hurt.
An education ministry spokeswoman, Nooria Nazhat, later raised the number of students who were slightly wounded to 51, from two schools.
The Taliban claimed the attack, which came as the insurgents were holding their latest round of talks with U.S. envoy Zalmay Khalilzad in the Gulf state of Qatar, where they have a political office.
The attack ended nearly 10 hours after it began with all five attackers dead, according to Interior Ministry spokesman Nasrat Rahimi.
Two police, a child, a private security guard and two passers-by were killed in the attack that began with a powerful car bomb, followed by a series of smaller explosions and a daylong gun battle, said Rahimi.
The Italian-run Emergency Hospital in Kabul — one of the largest hospitals in the Afghan capital treating war victims — said in a statement that it had received two bodies, including a child. Dozens more injured were treated, many of them later released.
WATCH: U.S. Secretary of Defense remarks on the country’s purpose in the war in Afghanistan
The insurgents struck during the morning commute, and ambulance sirens wailed across the downtown area.
Mohammad Karim, a police official in the area of the attack, said a car bomb exploded outside a Defence Ministry building. Militants then ran into a nearby high-rise located in a crowded market and began firing down on the ministry. Police and special Afghan security forces poured into the area and cordoned it off.
Mohammad Farooq, the owner of a nearby restaurant, said the explosion blew out the windows of a private school, wounding several students.
The capital has been relatively quiet in recent months following a spate of bombings, many claimed by the local Islamic State affiliate. The Taliban have carried out scores of attacks in Kabul in recent years, mostly targeting Afghan and U.S. military installations or convoys.
The U.S. condemned the attack. The statement from press secretary Stephanie Grisham said the “brazen attack demonstrates the Taliban’s callous disregard for their fellow Afghans, who have repeatedly voiced the urgency of finding a peaceful resolution to the conflict.”
Pakistan also condemned Monday’s attack, saying “such attacks are detrimental to the cause of peace, security and stability in Afghanistan.” Pakistan and Afghanistan routinely exchange accusations of harbouring the other’s militant enemies.
WATCH: Attack on police headquarters in Afghanistan by Taliban leaves 13 dead
Pakistan has reportedly pressed the Taliban — many of whom have homes in Pakistan — into talks. Last week it hosted Afghan President Ashraf Ghani for the first time as the two countries sought to reset their troubled relationship.
The latest talks between the United States and the Taliban meanwhile stretched into a third day. The Taliban said their focus is on getting an announcement of a timetable for the withdrawal of U.S. and NATO troops from Afghanistan. The announcement is likely to be accompanied by a Taliban promise to hold intra-Afghan talks and agree to an eventual cease-fire.
Suhail Shaheen, spokesman for the Taliban’s political office in Doha, told The Associated Press on Monday that “our main concern is to make sure a timeline for troop pullout is announced.”
Taliban officials have previously told the AP they want all foreign troops withdrawn within six months, while Washington has pushed for a longer timeline of a year to 18 months.
The Taliban have refused to hold talks with the Afghan government, calling it a U.S. puppet, and have continued to carry out daily attacks on Afghan forces. They say Washington is the final arbiter on the troop withdrawal, which the insurgents see as the central issue.
WATCH: ‘American Taliban’ John Walker Lindh to be released from prison
In a tweet on Monday, Shaheen said an intra-Afghan dialogue will begin only after a timeframe for the withdrawal of troops is announced “in the presence of international guarantors.” He did not identify the guarantors. He also said regardless of an announcement the Taliban were not prepared for talks with Afghan government members in their official capacity.
Washington accelerated attempts to find a negotiated end to America’s longest war with the appointment last September of Khalilzad, who was a special presidential representative to Afghanistan and later U.S. ambassador in Kabul in the years immediately following the 2001 U.S.-led invasion that ousted the Taliban.
During a visit last week to the Afghan capital, U.S. Secretary of State Mike Pompeo said Washington would like to see an agreement before Sept. 1, considered an ambitious deadline by analysts but likely linked to Afghan presidential polls scheduled for later that month. Washington has expressed concern the elections could hamper a peace deal and has quietly advocated for an interim administration for up to two years following an agreement.