KABUL:An ambulance packed with explosives blew up in a crowded area of Kabul on Saturday, killing at least 40 people and wounding 140 others, officials said, in an attack claimed by the Taliban.

"The latest toll from Kabul hospitals stands at 40 martyred and 140 wounded," health ministry spokesman Waheed Majroh told AFP.

A huge blast rocked Kabul on Saturday, AFP reporters and witnesses said, in the latest apparent attack in the Afghan capital.

AFP reporters heard a loud explosion that shook the windows of their compound, and photos shared on social media purportedly of the blast showed a huge plume of smoke rising into the sky.

The explosion happened in a crowded part of the city where the interior ministry, the European Union and the High Peace Council have offices. Kabul police headquarters is also in the vicinity of the blast.

"I can confirm an explosion happened near the old interior ministry building in Kabul," interior ministry deputy spokesman Nasrat Rahimi told AFP.

The explosion comes exactly a week after Taliban militants stormed a luxury hotel in Kabul, killing at least 22 people, the majority foreigners.

A security alert issued to foreigners on Saturday morning warned that the Islamic State group, which has terrorised the city in recent months, was planning "to conduct aggressive attacks" on supermarkets, shops and hotels frequented by foreigners.