Two explosive devices had been placed outside the school and detonated on Tuesday, Kabul police spokesperson Khalid Zadran told AFP.

He tweeted earlier in the day that three explosions had occurred.

Six people have died in the attack, according to Khalid Zadran.

- This is preliminary information.

We are on site and waiting for more details, he says.

Hospital: 24 injured

Eyewitnesses say that the attack took place when the students were on their way out of the morning lessons.

Pictures spread on social media show bodies lying on the ground at the scene, along with burned books and school bags, reports AFP.

- We left the school and had just gone out through the back gate when the explosion occurred, says student Ali Jan, who is being cared for in hospital for his injuries, to AFP.

Two hospitals in Kabul say they received a total of 24 injured.

Would help - injured

The second explosion occurred when people began arriving at the scene to help the injured from the first blow.

"When I heard the explosion, I called one of my friends who is studying at the school," store owner Murtaza, who was injured in the attack, told AFP.

- His phone was turned off.

So I went to the place.

And that was when I was hit by the second explosion.

No one has claimed responsibility for the attack.

The school, which is a school equivalent to high school or high school, is located in the Dasht-e-Barchi district in the western part of Kabul.

The area is largely inhabited by Hazaras, a Shia Muslim minority that has been targeted several times before for attacks by Sunni fundamentalist IS.