Explosions caused by a car bomb and mortars outside a school in the Afghan capital Kabul killed at least 55 people and wounded over 150, mostly female students, officials said, in an attack President Ashraf Ghani blamed on Taliban insurgents.

A senior security official told Reuters on condition of anonymity that most of the casualties were students coming out of the Sayed ul Shuhada school, and many were badly wounded in hospital.

Footage on TV channel ToloNews showed chaotic scenes, with books and school bags strewn across a bloodstained road, and residents rushing to help victims.

"It was a car bomb blast that occurred in front of the school entrance," an eyewitness told Reuters, asking not to be named. He said all but seven or eight of the victims were schoolgirls going home after finishing their studies.

At the Sayed ul Shuhada high school, girls and boys study in three shifts, the second of which is for female students, NajibaArian, spokeswoman for the Ministry of Education, told Reuters.

The wounded were mostly female students, she said.

At a nearby hospital, staff wheeled in injured students while dozens of distressed relatives searched for their sons and daughters, according to a Reuters witness.

"I do not know what country we are in ... We want peace and security," a grieving relative of one of the victims told Reuters.

Kabul has been on high alert since Washington announced plans last month to pull out all US troops by 11 September, with Afghan officials saying the Taliban have stepped up attacks across the country following the announcement.

No group has claimed responsibility for today's attack. Taliban spokesman Zabihullah Mujahid denied the group was involved and condemned the incident.

Although President Ghani blamed the Taliban, the explosions were in a heavily Shi'ite Muslim neighbourhood that has faced brutal attacks by Islamic State militants over the years, including one on a maternity ward almost exactly a year ago.

Mr Ghani said: "The Taliban, by escalating their illegitimate war and violence, have once again shown that they are not only reluctant to resolve the current crisis peacefully and fundamentally, but are complicating the situation."

"I saw many bloodied bodies in dust and smoke, while some of the wounded were screaming in pain," local resident Reza, who escaped the blast, told AFP, adding that most of the victims were teenage female students who had just left the school.

"I saw a woman checking the bodies and calling for her daughter. She then found her daughter's blood stained purse after which she fainted and fell to the ground."

Health ministry spokesman Dastagir Nazari said several ambulances had been rushed to the site and were evacuating the wounded.

He said an angry crowd had beaten the ambulance workers at the site.

Washington's top diplomat in Afghanistan, Ross Wilson, condemned the attack in a post on Twitter.

"With scores murdered, this unforgivable attack on children is an assault on Afghanistan's future, which cannot stand," he wrote.

The European Union delegation in Afghanistan condemned what it said was a "despicable act of terrorism".

"Targeting primarily students in a girls' school, makes this an attack on the future of Afghanistan. On young people determined to improve their country," it said on Twitter.

The United Nations Assistance Mission in Afghanistan (UNAMA) expressed its "deep revulsion" at the blast.

The Dasht-e-Barchi neighbourhood has been a regular target of attacks from Sunni Islamist militants.

In May last year a group of gunmen attacked a hospital in the area in a brazen daylight raid that left 25 people killed, including 16 mothers of new-born babies.

The hospital was supported by Doctors Without Borders, the international medical charity, which later pulled out of the project.

No group claimed that attack, but Ghani blamed the Taliban and the jihadist Islamic State group.

On October 24, a suicide bomber blew himself up at a tuition centre in the same district, killing 18 people including students in an attack that also went unclaimed.