Gunfire and explosions rang out across the city in a smart residential district near the famous Chicken Street shopping thoroughfare favoured by Westerners, and at least two foreigners were among those wounded.
"We can confirm that three UN staff have been killed,'' said Aleem Siddique, UN spokesman in Kabul, confirming what appeared to be a major breach of security in the heavily guarded Afghan capital.
The attack came with tensions rising in Afghanistan ahead of the scheduled presidential second-round election on November 7, and after a string of high-profile suicide attacks in recent months.
Police said the gunmen stormed the UN-approved guesthouse in the Shar-e-Now area of the capital around 5.30am (12pm AEDT), well before the start of the working day.
Police and other Afghan officials said at least one of the attackers was killed, possibly after detonating an explosives-packed vest, and several police officers were wounded.
At least two foreigners were seen being taken from the guesthouse with what appeared to be gunshot wounds, witnesses said.
Flames and heavy black smoke spewed into the sky from the area, where police closed off roads and surrounded the building.
Afghan police were locked in a stand-off with a "group of terrorists'' holed up in an apartment building, one police officer at the scene said.
The police officer told AFP that one of the gunmen detonated an explosives vest before the rest of the group ran into the apartment building in the crowded neighbourhood.
"We don't know how many of them there are,'' he said.
One policeman on the ground, who did not give his name, said there had been a huge blast inside the Bachter Guesthouse.
"One person from the armed group has been killed, and there are several police who have been wounded,'' health ministry spokesman Ahmad Farid Rahid told AFP by telephone.
Police jeeps with mounted machine-guns and fire engines were seen racing through the streets of the capital, an AFP photographer said.
"We claim responsibility,'' Taliban spokesman Zabihullah Mujahed said by phone.
"This is the first step, as we have warned that we will disrupt the second round of the elections.''
President Hamid Karzai and former foreign minister Abdullah Abdullah are due to face off after a fraud-tainted first round in August.
There was also low turnout in August after a vicious intimidation campaign by the Taliban.
The deaths come only a day after roadside bomb killed eight American soldiers, bringing their October death toll to 55.
President Barack Obama is also deciding whether to send more troops to the troubled region.
Source: The Australian