At least 15 Afghan soldiers were killed in Kabul on Saturday when a suicide attacker rammed a car full of explosives into a bus leaving the country's top military training centre.
Taliban insurgents claimed responsibility for the attack, the second suicide bombing in Kabul in 24 hours and the seventh major assault in Afghanistan since Tuesday. It capped one of the bloodiest weeks in the war-weary country in recent memory.
ISIL claimed responsibility for a suicide attack in the Afghan capital on Friday evening in which a bomber walked into a Shiite mosque as people were praying and detonated his explosives.
The toll in the attack on the Imam Zaman mosque rose to 54 killed, including children, and 55 wounded, a deputy minister for religious affairs, Dai-ul Haq Abid said on Saturday.
Meanwhile, ministry of defence spokesman Dawlat Wazari said four others were wounded in the Saturday attack that targeted soldiers.
"Army personnel were coming out of Marshal Fahim University when a suicide bomber in a car targeted them," he added.
President Ashraf Ghani's office said the bus was carrying trainers and cadets from the defence university on the western outskirts of Kabul that is home to the Afghan military's officer training school and other military academies.
Afghan security forces have been struggling against the Taliban since most foreign troops left at the end of 2014.
US president Donald Trump committed to an open-ended military training and support mission in Afghanistan in August, despite criticism that the country is no closer to peace despite billions of dollars in aid and nearly 16 years of US and allied operations.
Taliban spokesman Zabihullah Mujahid claimed responsibility for Saturday's car bomb. The militants have been waging an insurgency for a decade and a half in an attempt to overthrow the western-backed government in Kabul and re-establish a fundamentalist Islamist regime.
The insurgents now control or contest about 40 per cent of Afghanistan.
Nato's Resolute Support mission in Afghanistan tweeted that Saturday's assault on the army trainees was an "attack on the future" of the country and its security forces.
"This attack in #Kabul shows the insurgents are desperate and cannot win" against Afghanistan's security and defence forces, it added.
Afghan security forces, including police, were being killed at a rate of about 600 per month in battles and targeted bombings earlier this year, according to a US report.
This week's toll looked to be particularly heavy for Afghan forces after attacks across the country, including Taliban fighters using captured US-provided Humvee vehicles as vehicle bombs to ram into fortified compounds.
On Thursday, the Taliban stormed a military base in the southern province of Kandahar, killing at least 43 of the 60 soldiers manning the base, which was left in ruins.
Two days earlier, dozens of security personnel were killed and scores wounded in Taliban attacks on government compounds in Paktia and Ghazni provinces, with a senior provincial police commander among the dead.
In recent years, Afghanistan has seen a rise in violence claimed by fighters who have claimed loyalty to the ISIL's Middle East-based leadership, although the movement controls little territory in Afghanistan.
Following Friday night's attack on the Imam Zaman mosque in Kabul, people expressed anger at the government's inability to protect its citizens in the Afghan capital, which accounted for nearly 20 per cent of the country's civilian deaths in the first half of the year.
"If our government officials cannot protect us they have to resign and let other competent officials take charge," an eyewitness said.
Other witnesses described gruesome scenes after the attack.
"The windows of the mosque were broken, and blood and human flesh were spattered everywhere and you could smell blood and human flesh inside the mosque," said Ibrahim, who rushed to the mosque after the blast.
"This is absolutely barbarism. What kind of Islam is this? They are attacking worshippers at the time of prayers. Even mosques are not safe for us to pray."
Another mosque attack on Friday killed at least 33 people in central Ghor province.