A mob enraged by a Koran burning in the US stormed a UN compound in Afghanistan and killed seven staff, the worst attack on the world body in the country since the 2001 invasion.
Four Nepalese guards fought desperately against armed protesters Friday but were overwhelmed and died with three workers they were protecting at the compound in the normally relatively calm city of Mazar-i-Sharif.
The Taliban claimed responsibility for the violence following a battle lasting more than three hours in which part of the building was burned down amid small-arms fire and explosions, an AFP correspondent at the scene said.
US President Barack Obama condemned the attack "in the strongest possible terms", while UN chief Ban Ki-moon said it was "an outrageous and cowardly attack".
The UN did not announce the nationalities of the three civilian staff killed. But Sweden named one as 33-year-old Swede, Joakim Dungel. Norway said Lieutenant Colonel Siri Skare, a 53-year-old female pilot, was killed. Diplomats said the third was a Romanian.
The attackers broke away from a large demonstration in the city against the burning of a Koran, Islam's holy book, by a US pastor in Florida.
"Some of them were clearly armed and they stormed into the building" and set it on fire, UN peacekeeping chief Alain Le Roy told reporters after briefing the Security Council at UN headquarters in New York.
"The security guards, who were the Gurkhas, tried their best but the number was so high that they were not able to prevent it."
He denied reports that two of the dead were beheaded but said one victim had his throat cut.
UN officials said the Gurkhas, security mainstays in many world trouble spots, were believed to have killed a number of assailants before they were overcome.
Balkh provincial governor Atta Mohammad Noor said five other people, thought to be protesters, were also killed while at least 20 people were wounded in the fighting. About 20 people were arrested, he said.
A police spokesman said demonstrators seized weapons from guards before turning them on the staff.
An unknown number of UN staff were wounded and had been evacuated, Le Roy said. But the Mazar-i-Sharif base would remain open, he insisted, adding that he did not believe the United Nations had been a specific target.
Ban's chief of staff, Vijay Nambiar, and a top peacekeeping official had left for Afghanistan to conduct a review of security at UN facilities, Le Roy said.
The 15-nation UN Security Council held a special meeting on the incident, calling on the Afghan government to step up protection for UN workers.
Hundreds of people had taken to the streets of Mazar-i-Sharif to protest against last month's Koran burning, and local police spokesman Lal Mohammad Ahmadzai said Taliban militants had infiltrated the demonstrators.
He told AFP that "two of the killed UN staff were beheaded". But accounts of the killings were conflicting, with police official General Abdul Rauf Taj saying that "according to the initial reports... none have been beheaded. They were shot in the head".
Friday's attack was the worst suffered by the world body since a bomb blast at the UN compound in Algiers in 2007 in which 17 staff died.
In the last major attack on the UN in Afghanistan, five of its foreign staff were killed when three gunmen wearing explosives-packed vests attacked a Kabul guesthouse in October 2009.
In 2003 an attack on the UN's office in Baghdad killed 22 staffers, including top envoy Sergio Vieira de Mello.
Before Friday's violence Afghanistan had condemned the "disrespectful and abhorrent" burning of the Koran at the Dove World Outreach Center, an evangelical church in Gainesville, Florida, calling it an effort to incite tension between religions.
Pastor Terry Jones, the head of the church, told AFP that "we don't feel responsible" for the attack, adding: "The radical element of Islam takes (the burning) as an excuse to promote their violent activities."
The protest in Mazar-i-Sharif began after the traditional prayers.
The crowd called on the Afghan government to cut ties with the United States if the cleric behind the Koran burning was not prosecuted, and to declare the presence of foreign troops in Afghanistan illegal.