Gunmen with automatic weapons and suicide vests stormed a guest house used by U.N. staff in the heart of the Afghan capital early Wednesday, killing at least seven people including three U.N. staff, officials said. A Taliban spokesman claimed responsibility, saying it was meant as an assault on the upcoming presidential election.

Heavy gunfire reverberated through the streets shortly after dawn and a large plume of smoke rose over the city following the attack on the hostel in the Shar-e-Naw district. Kabul police chief Abdul Rahman Rahman said seven people were killed, including some attackers.

U.N. spokesman Adrian Edwards confirmed that three U.N. staff were among the dead and one was seriously wounded. He said 20 U.N. staff were living at the guest house, some of them known to be registered there but he was unsure whether all were there at the time of the attack.

Flames could be seen on the roof of the guest house. Hours after the attack began, three explosions could be heard but it was unclear if they were from that location.

It was the third major attack on 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.

Taliban spokesman Zabiullah Mujahid claimed responsibility for Wednesday's attack 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 the Taliban issued a statement threatening anyone working on the Nov. 7 runoff election between President Hamid Karzai and Abdullah Abdullah.

"This is our first attack," he said.

Afghans vote Nov. 7 in a second round election after U.N.-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.

President Barack Obama has been waiting for the ballot before deciding whether to send tens of thousands more troops to confront the growing Taliban insurgency. The fraud-marred election cast doubt on whether the Afghan government would be a reliable partner in the fight against the extremists.

The Kabul attack occurred one day after roadside bombs killed eight U.S. service members, driving the American death toll to a record level for the third time in four months.

Such bombs, also called improvised explosive devices or IEDs, are responsible for between 70 percent and 80 percent of the casualties among U.S. and coalition forces in Afghanistan and have become a weapon of "strategic influence," said Lt. Gen. Thomas Metz in Washington.

The attacks Tuesday followed one of the deadliest days for the U.S. military operation in Afghanistan - grim milestones likely to fuel the debate in the United States over whether the conflict is worth the sacrifice.

Obama has nearly finished gathering information on whether to send tens of thousands more American forces to quell the deepening insurgency, White House press secretary Robert Gibbs said. A meeting Friday with the Joint Chiefs of Staff will be among the last events in the decision-making process, Gibbs said.

Both attacks Tuesday took place in the southern province of Kandahar, said Capt. Adam Weece, a spokesman for American forces in the south. The region bordering the Pakistan frontier has long been an insurgent stronghold and was the birthplace of the Taliban in the 1990s.

The Americans were patrolling in armored vehicles when a bomb ripped through one of them, killing seven service members and an Afghan civilian, U.S. forces spokesman Lt. Col. Todd Vician said.