Two Kenyans and seven Somali guards were killed in a bomb attack on a vehicle carrying workers to the United Nations compound in Garowe in the Somali region of Puntland on Monday, police said.
Somali Islamist militant group al Shabaab has claimed responsibility of carrying out the bombing in the northeastern city as police had suspected.
"A blast hit the bus carrying workers to the UN office ... At least nine people died," he told Reuters.
Six bystanders were wounded, he added.
Images posted on social media show a blood-spattered white minivan, its windows shattered and the vehicle roof blown off by the blast.
Nicholas Kay, the UN Special Representative for Somalia, condemned the attack, saying on his Twitter feed he was "shocked and appalled by loss of life."
Al Shabaab has staged several attacks against UN officials in Somalia in recent years, most often in the capital Mogadishu, where the UN has been helping a Western-backed government rebuild the country after more than 20 years of war.