Kabul: In what is considered one of the deadliest assaults on the Afghan capital this year, at least 43 people were killed on a Kabul government compound in an hours-long gun and bomb attack.

No militant group has claimed responsibility for the raid, which caps a bloody year for Afghanistan as long-suffering civilians and security forces have been slaughtered in record numbers.

Several others were wounded in Monday's massacre on a site where the Ministry of Public Works and an office that handles pensions and benefits for war veterans are located, health ministry spokesman Waheed Majroh said.

Gunmen stormed the compound mid-afternoon after detonating two car bombs at the main entrance, which is opposite residential apartment blocks.

Many people jumped from windows to escape while hundreds of people were trapped when gunmen stormed the building and began moving from floor to floor targeting employees.

Reportedly, the others killed included a police officer and three of the attackers, who were shot dead by Afghan security forces.

Afghanistan, de facto Prime Minister Abdullah Abdullah blamed the Taliban and said, "Every attack they carry out against our people, our resolve is further strengthened to eliminate them.”

But their statements belie the grim reality on the battlefield where the Taliban have the upper hand.

Afghanistan's largest militant group has made significant territorial gains this year as its fighters inflict record casualties on government forces.

US President Donald Trump’s plan to reduce the number of troops is also a cause for concern as this could impede efforts to end the conflict with Taliban.

There have been no orders to pull forces out of the country, General Scott Miller, the top US and NATO commander in Afghanistan said on Sunday.

While Trump’s decision came on Tuesday, the Ghani government could collapse if US troops pulled out. Many Afghans fear another civil war around the corner if the Taliban comes back in to power.