UN Secretary General Ban Ki-moon has condemned as "shocking and shameless" a Taliban raid which killed at least five UN workers in the Afghan capital Kabul.
Three Afghans also died when suicide bombers stormed a UN guesthouse in the city, but Mr Ban said the UN would not be deterred from its mission there.
The Taliban said the attack was the first step in its bid to disrupt next week's presidential run-off election.
But the White House said such attacks would not derail the vote.
In a separate attack, rockets were fired at the city's five-star Serena Hotel, but no-one was injured.
The attack on the private Bekhtar guesthouse in the Shar-i-Naw district was the deadliest on the United Nations in Afghanistan since the fall of the Taliban regime in 2001.
Andrew North, BBC News, Kabul
These attacks on two high-profile targets have spread a lot of fear.
Every building where UN staff work or live has to conform to minimum security rules, and one question that will be asked is 'How did these gunmen get into this building?'
President Hamid Karzai has said he wants more security for foreign workers, but there is more security in place now than ever before, more concrete blast barriers, more troops in the street, but that still cannot prevent determined militants getting through.
Will sending more troops turn the tide? That is the question that right now US President Barack Obama is facing.
Zabiullah Mujahid, a spokesman for the Taliban, said they carried out the raid, in a telephone call to the Associated Press news agency.
He said it was the "first attack" in the run-up to the second round of the presidential election on 7 November.
In New York, Mr Ban said: "This is a sad day and a very difficult day for the United Nations."
"I want to extend my deepest condolences to the families, and to our UN family."
He condemned the "shocking and shameless act", but he said the UN would not be deterred from its "noble mission".
"We stand by the people of Afghanistan today, and we will do so tomorrow," he said.
Mr Ban pledged to review security procedures in Afghanistan and take all necessary measures to protect its staff there.
White House spokesman Robert Gibbs said President Barack Obama was confident that existing security arrangements were appropriate.
"The administration is confident that there are the appropriate resources to conduct an election and that the will of the Afghan people won't be thwarted," Mr Gibbs told reporters in Washington.
The head of the UN mission in Afghanistan, Kai Eide, said he could not yet give details of the nationalities of the victims, although the US embassy has confirmed one of the dead was an American.
UN officials initially said six of its workers had been killed, but later revised the figure to at least five dead and nine wounded.
In addition to the UN staff, two Afghan security personnel and a civilian were killed.
Afghan President Hamid Karzai said the attack was "an inhuman act".
Nato Secretary General Anders Fogh Rasmussen also condemned the attack.
"The victims of these terrorist attacks were devoted to helping the Afghan people build better lives. In targeting them, the Taliban has demonstrated once again that it is truly an enemy of the Afghan people."
The attack on the guesthouse, which is used by the UN and other international organisations, happened just before 0600 (0130 GMT).
KABUL YEAR OF VIOLENCE
28 Oct: Five UN staff and three Afghans killed in attack on UN guesthouse
8 Oct: Suicide bomber attacks Indian embassy, killing at least 17
17 Sept: Six Italian soldiers and 10 Afghans die in bomb attack on military convoy
18 Aug: Suicide car bomber kills 10 in attack on convoy of Western troops
11 Feb: Assault on three government buildings kills 27, including eight attackers
At least 25 UN workers were at the guesthouse, including 17 members of the election team.
Three Taliban militants with suicide vests, grenades and machine guns carried out the assault.
UN spokesman Aleem Siddique told the BBC there was gunfire and an explosion outside the guesthouse as UN employees tried to flee. The building was gutted by fire.
The three gunmen were shot dead and the incident ended at about 0830 local time.
There has been heightened tension in Afghanistan since the first round of the presidential election, which was marred by widespread fraud.
The UN is playing a leading role in organising the run-off vote, and the BBC's Ian Pannell in Kabul says the attack is clearly a tactic of the Taliban to prevent its staff from going about their business safely.
Mr Karzai will face his rival Abdullah Abdullah in the 7 November vote.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.