The discovery of the militant Islamic State (IS) group's hideout, filled with explosives and suicide vests, in a poor Kabul neighbourhood, reflects the failure of Afghanistan's corruption-wracked government to protect the capital, analysts and residents said on Friday.

This week's revelation that militants were operating in Kabul's western Qala-i-Wahid district follows a recent series of horrific attacks in the heavily guarded city that killed nearly 200 people and wounded hundreds more, including foreigners.

Security forces were led to the safe house by an insurgent who was captured during an attack on Monday by IS militants on a military academy in Kabul in which 11 soldiers died, according to an intelligence official.

From behind the 10-foot green metal doors, the insurgents were plotting to use the explosives, weapons and suicide vests in three more large attacks in Kabul, the official said. He spoke on condition of anonymity in line with his agency's rules and did not elaborate on the plans.

Khan Mohammed, a resident of Qala-e-Wahid, told the AP that locals rarely see a police patrol in the neighbourhood and stay at home after dark because of marauding gangs of thieves. They say the government can't provide security.

“It is dangerous for all the people of Qala-e-Wahid that Daesh was here, but they came here because it is an insecure area,” Mohammed said, using the Arabic acronym for the terrorist group.

“For Daesh, this was the perfect area because you can bring everything here from anywhere,” added Mohammed, whose home is across the lane from the IS hideout.

Political analyst Haroon Mir blamed widespread corruption throughout the government and the security forces for their inability to prevent the recent deadly attacks in Kabul, which included a siege at a luxury hotel and a car bomb packed inside an ambulance. “It is the utter failure of the intelligence services. It is the utter failure of the security services. It is the utter failure of every institution,” Mir said.

“You can't blame it on lack of resources or lack of international support,” he said, adding that billions of dollars in international money flowing into Afghanistan in the past 16 years has been siphoned off by those in positions of power. That has left most Afghans feeling vulnerable.

“There is no security in this country,” said Mohammad Hajan, an elderly man interviewed near the IS safe house. “In the morning, I wake up and I don't know if I will be alive in the evening.”

The streets that weave through Qala-e-Wahid are rutted and ankle deep in mud. A wide open sewer runs the length of the lanes, clogged with garbage bags, mounds of trash and human waste.

Foreigners are eyed with suspicion by some residents who refused to identify the IS safe house. There are whispers of possible IS sympathisers in the neighbourhood. Other residents who are willing to talk say the dangerous men in their neighbourhood come from many places because the security services are nonexistent.

Zikarullah, a 15-year-old who lives in a sunbaked mud-and-straw home opposite the IS hideout, said the three men and one woman who occupied the safe house had moved in about 25 days earlier. They had engaged freely with the neighbours, he said.

“One of them asked me if I liked cricket and said he would buy me a new cricket ball and bat,” said Zikarullah, who like many Afghans uses only one name. The occupants were young, and the woman always wore an all-enveloping burqa.

Afghan security forces, aided by the US-led coalition, have been targeting suspected IS hideouts in Afghanistan's eastern Nangarhar province, where the militants are believed to have established their most extensive bases. Increasingly, however, the IS has gained in strength in northern Afghanistan, where ethnic Uzbeks have been recruited into their ranks.

There are an estimated 5,000 IS fighters in northern Afghanistan between Sar-e-Pul province and eastern Badakhshan province, said Brian Glyn Williams, the author of “Counter Jihad, The American Military Experience in Afghanistan, Iraq and Syria”. He cited Afghanistan Vice President Rashid Dostum for the statistic.

President Ashraf Ghani, who faces pressure over the security lapses, went on national television on Friday to blame neighbouring Pakistan for harboring Taliban militants. Pakistan routinely denies it is a hub for the Taliban.

Ghani also said he has called for a review of security arrangements in Kabul.

Corruption has poisoned Afghanistan's security forces, said security analyst Waheed Mozhdah, noting that they can be bribed to “bring ammunition, explosives, everything inside Kabul. This is our big problem.”

Mir, the political analyst, said terrorism is a new source of income for some of the poorest residents of Kabul. He said some can earn up to $4,000 to spirit a suicide bomber into the city.

The deteriorating security can also be blamed on the protracted feud between Ghani and powerful warlords, including Dostum, who currently is in Turkey and prevented by the government from returning to Afghanistan.

Ghani has fired the powerful Tajik warlord Atta Mohammed as governor of northern Balkh province, but he has refused to step down. “Our nation is very good,” said Hajan, the elderly resident of Qala-e-Wahid. “But our leaders are bad, and our government is weak.”