The dead included a soldier and five civilians, Abdifitah Halane said. Another dozen people were injured.
The blast was detonated after soldiers tried to stop the car and the bomber tried to speed through the checkpoint, police Capt Mohamed Hussein said.
The checkpoint is one of several that motorists must go through before reaching the heavily guarded presidential palace, which has seen previous attacks by the al-Qaida-linked extremist group al-Shabab.
There was no immediate claim of responsibility, but al-Shabab often claims deadly bombings in Mogadishu.
More From This Section
The threat of al-Shabab attacks is a major challenge for the country's new Somali-American president, Mohamed Abdullahi Mohamed, who has vowed to make security a priority in this Horn of Africa nation.
But the extremist group, which was kicked out of Mogadishu under Mohamed's brief term as prime minister in 2010-2011, has denounced the new president as an "apostate" and warned Somalis against supporting him.
Al-Shabab has lost most of its key strongholds across south and central Somalia to a multi-pronged offensive by allied Somali and African Union forces. But despite being ousted from most cities and towns, the group continues to carry out deadly attacks, many by suicide bombers, including in Mogadishu.