Gunmen wearing suicide vests stormed a guest house used by UN staff in the heart of the Afghan capital early Wednesday, killing 12 people — including six UN staff — officials said. The US Embassy said one of the UN dead was American.

Download the new Independent Premium app Sharing the full story, not just the headlines

A Taliban spokesman claimed responsibility for the early morning attack, saying it was meant as an assault on the upcoming presidential election.

Later, a rocket struck the "outer limit" of the presidential palace but caused no casualties, presidential spokesman Humayun Hamidzada said. Another slammed into the grounds of the luxury Serena Hotel, which is favored by many foreigners. The device failed to explode but filled the lobby with smoke, forcing guests and employees to flee to the basement, according to an Afghan witness who asked that his name not be used for security reasons.

President Hamid Karzai condemned the attack as "an inhuman act" and called on the army and police to strengthen security around all international institutions.

The chief of the United Nations mission in Afghanistan, Kai Eide, said the attack "will not deter the UN from continuing all its work" in Afghanistan.

A security guard working nearby said the attackers were wearing police uniforms. He spoke on condition of anonymity because he wasn't supposed to talk to media.

UN spokesman Adrian Edwards said six UN staff were killed and nine other UN employees were wounded in the assault, which began about dawn in the Shar-e-Naw area of the city. Terrified guests fled the building during the assault — some screaming for help and others jumping from upper floors as flames engulfed part of the three-story building.

Afghan police and UN officials said 12 people in all were killed, including the UN staff, three attackers, two security guards and an Afghan civilian. The bodies of the attackers were taken out of the house and sent for autopsies, said Gul Mohammad, an officer at the scene.

It was not immediately known how the victims were killed or how the fire started, but witnesses said they heard prolonged gunfire ringing from the house before police arrived at the scene. It also was not immediately clear whether there were any other attackers besides the three killed.

Police were seen pulling the charred body of what appeared to be a woman from a second-floor bedroom. One officer carried an injured German man by piggyback away from the scene.

Daily coronavirus briefing No hype, just the advice and analysis you need Enter your email address Continue Continue Please enter an email address Email address is invalid Fill out this field Email address is invalid Email already exists. Log in to update your newsletter preferences Register with your social account or click here to log in I would like to receive morning headlines Monday - Friday plus breaking news alerts by email Update newsletter preferences

A US Embassy statement said an American was killed but did not identify the victim.

Edwards said officials were trying to account for several other UN workers who were staying at the guest house. He did not know their nationalities but said they were non-Afghans.

"This has clearly been a very serious incident for us," Edwards said. "We've not had an incident like this in the past."

Edwards said the UN would have to evaluate "what this means for our work in Afghanistan." The Aug. 19, 2003, truck bombing of the UN headquarters in Baghdad, which killed 22 people, prompted the UN to pull out of Iraq for several years.

A security guard, Noor Allah, said he saw a woman screaming for help in English from a second-story window and watched as terrified guests leapt from windows. Afghan police using ladders rescued at least one wounded foreigner.

Taliban spokesman Zabiullah Mujahid claimed responsibility for the attack on the guest house and the Serena in a telephone call to The Associated Press, saying three militants with suicide vests, grenades and machine guns carried out the assault.

He said three days ago that the Taliban issued a statement threatening anyone working on the Nov. 7 runoff election between Karzai and Abdullah Abdullah.

"This is our first attack," he said.

Afghans vote Nov. 7 in a second round election after UN-backed auditors threw out nearly a third of Karzai's votes from the Aug. 20 ballot, determining widespread fraud. That pushed Karzai's totals below the 50 percent threshold needed for a first round victory in the 36-candidate field.

The Taliban warned Afghans to stay away from the polls or risk attacks. Dozens of people were killed in Taliban attacks during the August balloting, helping drive down turnout.

Mir Ahmed Formoly, 64, who lives near the guest house, said he heard the commotion and went outside where he saw muzzle flashes in the early morning light.

"I was so scared," he said. "I went back inside the house."

He said gunfire and explosions lasted about two hours, punctuated by shouts and screams.

Mohammad Ayub, a shopkeeper who lives a few doors down from the attacked house, said he heard gunfire shortly before dawn. He assumed at first that it was an attack on a house belonging to relatives of President Karzai nearby, then saw that it was a different building.

"It was early morning, but I didn't have a watch on to know when. It was dark. Shooting started around this private guest house. I heard some shouts coming from inside the house," Ayub sai

"I heard 'Boom! Boom!' several times. The fighting went on inside for about 10 or 15 minutes before the police came," he said.

The guesthouse attack was the third major assault in the capital in recent weeks.

On Oct. 8, a suicide car bomber detonated his vehicle outside the Indian Embassy, killing 17 people — mostly civilians — and wounding at least 76 more. The Afghan Foreign Ministry hinted at Pakistani involvement — a charge Pakistan denied.

On Sept. 17, a suicide car bomber killed six Italian soldiers and 10 Afghan civilians on one of Kabul's main roadways.