A suicide bomber has killed 15 Afghan army cadets as they were leaving their base in the capital, Kabul, officials said, taking the death toll from attacks this week across the war-torn country to more than 250.

The suicide bombing on Saturday was the second such incident in Kabul in 24 hours, and the seventh major assault in Afghanistan since Tuesday.

In an email to journalists, the Taliban said it was responsible for the ambush on the army cadets. The group has been involved in four other attacks on police and military bases this week.

Dawlat Waziri, defence ministry spokesman, said the suicide bomber targeted a minibus carrying the trainees right in front of a military academy in the Charrahi Qambar area of Kabul.

NATO's Resolute Support mission tweeted that the latest incident was an "attack on the future" of Afghanistan and its security forces.

This attack in #Kabul shows the insurgents are desperate and cannot win against #ANDSF on the battlefield (2/2) — Resolute Support (@ResoluteSupport) October 21, 2017

Earlier on Saturday, two rockets landed near the international military headquarters in Kabul, in an attack claimed by the Taliban.

The spate of deadly attacks underscores deteriorating security across Afghanistan as the resurgent Taliban step up their attacks on security installations with devastating effect and the Islamic State of Iraq and the Levant (ISIL, also known as ISIS) armed group continue to target Shia mosques.

{articleGUID}

"The Afghan security forces are facing a resurgent Taliban, and ISIL is also weighing in," Al Jazeera's Jennifer Glasse, reporting from Kabul, said.

"It's a big challenge for the Afghan security forces as they try and grapple back territory from the Taliban who control or contest almost 40 percent of the country," she added.

"It's a very difficult task for these forces who are taking punishing casualties in the continuing fight."

Habib Wardak, a security analyst, told Al Jazeera that both the Taliban and ISIL "are trying to portray that they have the ability to inflict damage not just to the Afghan security forces and the Aghan government, but also to its international counterparts wherever and whenever they want to".

Mosque attacks

On Friday, two separate attacks on mosques killed scores of people in Afghanistan.

A suicide bomber blew himself up in a Shia mosque in Kabul, killing 56 people and wounding 55 others in an assault claimed by ISIL.

The Imam Zaman Mosque in the city's Dashti Barch area was half full, with about 300-400 worshippers attending Friday prayers.

{articleGUID}

Al Jazeera's Glasse, reporting from inside the mosque on Saturday, said that the bomber waited until prayers started before launching the attack.

He first threw grenades into a curtained-off area where women and children were praying, before blowing himself up in the middle of the worshippers, killing the imam and dozens of others.

"They do this to divide us, but they won't be able," Mohammad Musa Sultani, a regular volunteer at the mosque who helped the wounded and moved the dead, told Al Jazeera.

Knocked down by the blast, Sultani then ran inside the mosque and saw smoke and blood everywhere.

He was knocked down by the blast then ran inside. He says there was smoke and blood everywhere. He helped the wounded and moved the dead.

"There are foreign hands behind such attacks and they do it for their benefits through their slaves. Why do they come to attack this mosque?"

Friday's second attack during prayers occurred at a Sunni mosque in the central province of Ghor.

Afghan President Ashraf Ghani said these attacks and others across Afghanistan are crimes against humanity and contrary to Islamic values

"Terrorist groups will never succeed in their sinister goals for divisiveness and will soon be suppressed and destroyed by the legitimate struggle of the Afghan security and defense forces," he said in a statement.