Somalia's Shabab Islamists killed six UN workers on Monday when they set off a huge bomb which ripped through a staff bus in the northeastern town of Garowe.
Four of those killed worked for the UN children's agency UNICEF, while four other UNICEF staff were in a "serious condition", the agency said in a statement.
The head of the United Nations in Somalia, Nick Kay, said he was "shocked and appalled" by the loss of life, while Somali President Hassan Sheikh Mohamud condemned a "brutal attack".
Somalia's Al-Qaeda-affiliated Shabab insurgents claimed responsibility for the attack, branding the United Nations a "colonisation force in Somalia".
Local police chief Ahmed Abdulahi Samatar said four of those killed were foreigners and two were Somalis, while seven others were also wounded, two of them foreigners.
"In attacking UNICEF, Al Shabab has also attacked Somali children," Mohamud added. "It is an attack against the future of our country and I condemn it in the strongest possible terms."
The minibus, marked with the UN logo, was ripped apart by a ferocious blast.
"The improvised explosive device attack occurred when the staff were travelling from their guest house to the office, normally a three-minute drive," UNICEF said in a statement.
It was not clear if the bomb had been detonated by a suicide attacker or planted on the bus.
No details of nationalities of the foreigners killed and wounded were given.
Garowe, in the northeastern region of Somalia, is capital of the semi-autonomous Puntland region.
'Total disregard for life'
Shabab spokesman Abdulaziz Abu Musab confirmed the Islamist group had carried out the attack.
"We targeted the UN in Garowe, we killed some and wounded others. They are part of the colonisation force in Somalia," he told AFP.
The Shabab, meaning "youth", emerged out of a bitter insurgency against Ethiopia, whose troops entered Somalia in a 2006 US-backed invasion to topple the Islamic Courts Union that was then controlling the capital Mogadishu.
Shabab rebels continue to stage frequent attacks in their fight to overthrow Somalia's internationally-backed government, as well as to counter claims that they are close to defeat due to the loss of territory, regular US drone strikes against their leaders and defections.
They have also carried out revenge attacks across the wider region against countries which contribute troops to the 22,000-strong African Union force in Somalia, AMISOM.
Earlier this month Shabab gunmen attacked Garissa university in northeastern Kenya, killing nearly 150 people, mostly students.
Attacks against the United Nations are also common. In December four people were killed when a suicide bomber rammed a car packed with explosives into a UN convoy in the capital Mogadishu.
In June 2013, Shabab gunmen stormed a UN compound in the capital Mogadishu, killing 16.
UN aid chief for Somalia Philippe Lazzarini said he was "horrified" by the attack on Monday, which he said showed a "total and abject disregard for life", while African Union envoy Maman Sidikou said killing those trying to help others was a "crime against humanity."
In other recent attacks Shabab gunmen shot dead a Puntland lawmaker, Adan Haji Hussein, on Saturday and on Sunday killed three African Union troops in an ambush in the south of the war-ravaged country.
While the Shabab emerged as a Somali Islamist group in 2006 in Mogadishu, they have recruited across the wider region.