The explosions occurred at the Abdul Rahim Shahid high school in the Shiite-dominated area west of the city. It is stated that the number of dead and injured may increase.
A nearby classroom was also attacked with a hand grenade.
No one took responsibility for the attack. Daşt-i Barçi, predominantly inhabited by Hazaras, is a region frequently targeted by ISIS militants.
Initial reports of the incident suggested that high school students and staff were targeted by suicide bombers. However, Kabul police spokesman Khalid Zadran said improvised explosive devices were left outside the school and six people were killed.
“These are the first numbers. We are at the scene and waiting for more details,” the spokesperson said.
Speaking to Reuters agency, an official said that explosives were placed in backpacks and one of them was detonated inside the school.
Sources from the Mohammed Ali Jinnah Hospital in Kabul told the BBC that four bodies and 19 injured were previously brought to the hospital in connection with the school attack. Other benefits are being treated elsewhere.
A region targeted by ISIS attacks
An eyewitness told the AFP news agency that the explosions occurred as students were leaving their morning classes.
The Daşt-i Barçi region, where the attacks took place, has been the target of ISIS attacks before, largely due to its Hazara Shiite Muslim population.
The Hazaras are an ethnic and religious minority in Afghanistan that ISIS deems heretical and targeted.
Local sources also said that a hand grenade was thrown at a nearby classroom that prepares students for the university entrance exam.
After the Taliban took over the country last year, ISIS attacks gained momentum for a while, and then the group’s activities decreased.
ISIS has been carrying out attacks against Shiites in Afghanistan for the past few years. Many lives were lost in bomb attacks against targets such as sports halls, cultural centers and educational venues.
Last May, more than 90 students and staff were killed in an attack by ISIS on a girls’ school in Dasht-i Barchi.