A suicide bomber and extremists armed with assault rifles and explosives attacked a government building in the Afghan capital in an eight-hour-long siege, authorities said. It ended when the three gunmen were killed.

Health Ministry spokesman Wahid Majroh said Tuesday that 43 people lost their lives, not including the attackers.

The toll could rise as police continue to search the smoldering building, Interior Ministry spokesman Najib Danish said.

Get Breaking News Delivered to Your Inbox

No one immediately claimed responsibility for the attack. The Taliban and a local Islamic State affiliate have carried out a relentless wave of assaults on government targets in recent years, but the Taliban denied involvement in this one.

The attack began when the suicide bomber blew up his explosives-laden car in front of the multi-story building that houses a public welfare department in an eastern neighborhood of Kabul, Danish said. Minutes later, three gunmen entered the building and rampaged through the office complex hunting for victims. Some employees managed to barricade themselves inside offices while police quickly evacuated 357 people, officials said.

Witnesses reported hearing at least five explosions as police and gunmen traded fire. One officer died and three were wounded.

Afghan security forces arrive at the site of an explosion and attack by gunmen, in Kabul, Afghanistan, Monday, Dec. 24, 2018. Rahmat Gul / AP

Police cordoned of the area as they tried to secure the building, but Danish said the operation was painstakingly slow as officers moved carefully from room to room and floor to floor.

Kabul police spokesman Basir Mujahid said authorities received at least one telephone call from inside the building, but frightened employees were unable to provide any details. No one claimed responsibility, but both the Taliban and the local Islamic State of Iraq and Syria (ISIS) affiliate have carried out brazen daytime attacks in the capital.

The building is in area that includes several apartment buildings as well Afghanistan's department for public works. A witness said ambulances raced to the scene during a lull in the shooting, Reuters news agency reports.

The attack came four days after U.S. President Trump announced the withdrawal of half of the 14,000 American troops and just hours after Pakistan's Foreign Minister Shah Mahmood Qureshi was in Kabul to discuss a negotiated end to Afghanistan's 17-year war. Qureshi, who then continued his trip to Iran, condemned the attack.

An Afghan police officer at the scene of the attack in Kabul, Afghanistan, on Dec. 24, 2018. Omar Sobhani / REUTERS

Pakistan helped orchestrate last week's peace talks in the United Arab Emirates, where representatives from Saudi Arabia, the UAE, Pakistan and the U.S. met with the Taliban.

Taliban insurgents control nearly half of Afghanistan and are more powerful than at any time since a 2001 U.S.-led invasion. They carry out near-daily attacks, mainly targeting security forces and government officials.

The U.S. and NATO formally concluded their combat mission in 2014, but American and allied troops remain, conducting strikes on the Islamic State group and the Taliban and working to train and build the Afghan military.