"We have confirmed the death of six people, four of them civilians, while six others were also wounded, some seriously," police officer Abdukadir Hassan told AFP.
He said no UAE diplomats were hurt in the attack, with the Somali security staff escorting them stopping the bomber with their truck as the blast went off.
The Shebab said they carried out the attack, which is believed to be the first time the Al-Qaeda affiliate has targeted the UAE in Somalia. The UAE is involved in a number of security, infrastructure, development and humanitarian projects in Somalia.
"A suicide bomber rammed his car into the pick-up truck and there were casualties," said Somali security official Abdi Dahir. "There was a heavy explosion."
More From This Section
A military convoy from the African Union force in Somalia (AMISOM) was also passing nearby at the time of the attack close to the UAE embassy, witnesses said.
"I saw the dead bodies of two people, and there were several wounded soldiers," said Abdulahi Yasin, who saw the aftermath.
United Nations envoy to Somalia, Nick Kay, condemned the "utterly cruel terror attack against UAE in Somalia".
Kay said he had spoken to the UAE ambassador, Mohamed Al Osmani, who was not harmed in the attack.
Shebab attacks seek to counter claims that they are close to defeat after losing territory in the face of an AU and Somali government offensive, regular US drone strikes against their leaders and defections.
The militants have also carried out a string of revenge attacks in neighbouring countries -- including the September 2013 attack on the Westgate shopping mall in the Kenyan capital Nairobi, which left at least 67 people dead, and the April massacre of close to 150 students in Garissa in Kenya's northeast.
The current government is being supported by a 22,000-strong AU force that includes troops from Burundi, Djibouti, Ethiopia, Kenya and Uganda.