Abdul Hai Nemati, the governor of Baghlan, said at least nine security forces were still missing and four others were wounded in the attack.
But the attack bore the hallmarks of previous suicide bombings by the Islamic State militia, many of them on mosques, shrines and other targets in the same Shiite and ethnic Hazara area of Kabul, a densely crowded community called Dasht-i-Barchi.
The Taliban, who have been intensifying their attacks against military and government centers in recent weeks, issued a statement denying involvement.
This comes as the anti-government armed militants have been attempting to expand their attacks in the key provinces and cities of the country during the recent months.
Most of the victims were young men and women - high school graduates - studying together at a private education center in the Dasht-e Barcha area.
Two gunmen besieged a compound belonging to the Afghan intelligence service in a northwestern Kabul neighbourhood early Thursday, opening fire as Afghan security forces moved in to cut them off.
The ministry's spokesman, Wahid Majroh, says the figures are not final and that the toll from Wednesday's attack could rise further. "Mounting civilian casualties show beyond any doubt that Afghanistan and, in particular, its capital, Kabul, are not safe". He also said that 194 insurgents had been killed and 147 wounded.
United Nations Assistance Mission in Afghanistan (UNAMA) condemned the attack, saying in a tweet there is "no justification whatsoever for targeting civilians, at any time, under any circumstances".
Along with the 17 troops killed in the attack in northern Faryab province, in the district of Ghormach, at least 19 soldiers were also wounded, according to the spokesman for the defense ministry, Ghafoor Ahmad Jawed.
Stormy Daniels pulled of Celebrity Big Brother after 'row with producers'
Panellist Jane Moore, who spoke to Daniels off-air, said a custody battle involving her daughter in the USA was to blame. Moore, who spoke to Daniels off-camera and took a photograph with her, told viewers: "This is her side of the story".
Officials from the Independent Human Rights Commission of Afghanistan (AIHRC) on Wednesday said that human rights violations were committed in Ghazni and in many cases war crimes occurred, during the four-day siege on the city.
As reported by Tolo News, a police source confirmed that the Taliban insurgents assaulted the Allahuddin base in the Baghlan district.
No group immediately claimed responsibility for the bombing.
Meanwhile, a Taliban assault on two adjacent checkpoints in northern Afghanistan late on Tuesday night killed at least 30 soldiers and policemen.
The assault on the city has been the largest tactical onslaught since an unprecedented truce in June brought fighting between the Taliban and security forces to a temporary halt, providing war-weary Afghans some relief.
Ghazni residents who arrived in Kabul after fleeing the violence told AFP that the dead bodies of militants and soldiers continued to litter the streets, while government offices have been set ablaze by Taliban fighters and food prices are rising.
The Taliban seem to be intent on seeking a position of strength ahead of expected talks with the United States, which has been at war in Afghanistan for almost 17 years.
Afghanistan is littered with unexploded ordnance left by decades of war.
More than 100 security forces, apart from the Ghazni fatalities, have been killed in a series of attacks in the past few days in Afghanistan.