The blast took place just after the United Nations convoy left the palace at the end of a conference on the country’s upcoming general elections in 2016.
Presidential guards and a Turkish national are believed to be among the dead, as most delegates had left, according to BBC.
There was no immediate claim of responsibility from the Islamist militant group al Shabaab.
Al Shabaab is trying to overthrow the internationally-backed government in Mogadishu, which is protected by 22,000 African Union AMISOM troops from Burundi, Djibouti, Ethiopia, Kenya and Uganda.
A military offensive in 2014 by the AMISOM force and the Somali army pushed al Shabaab out of major strategic centers and into smaller pockets of the territory.
But the group, which once ruled much of Somalia, still holds some settlements and rural areas, which can often be used to isolate towns by cutting off supply routes.
This month, the Al-Qaida linked group attacked an AMISOM base in Janale area, killing at least 12 Uganda troops, and has retaken at least three other towns in southern and central Somalia.
The government has dismissed the gains by al Shabaab, saying the areas retaken are not of strategic value.