The Somali armed group al-Shabab claimed responsibility for Monday's explosion, which targeted former minister and MP Mohamud Abdi Ibrahim.
"The MP himself was driving the car. A bomb had been placed in his car without his awareness," deputy Mogadishu Mayor Warsame Mohamed told reporters on Monday.
"The MP died. His flesh and documents are in the car," said Mohamed, referring to Ibrahim, who was also a former minister for humanitarian affairs and trade.
Sources told Al Jazeera the explosion was triggered when the ignition of the car was turned on.
Al Jazeera's Nazanine Moshiri, reporting from Mogadishu, said: "We heard the explosion and it was pretty loud. What we saw at the scene was a car which had obviously exploded. Now we understand there was a bomb inside the car.
"The explosion happened in a district which is right in the heart of Mogadishu around 800m away from Villa Somalia and the government offices; the president of Somalia actually lives there," she said.
Police Colonel Ali Mohamed confirmed the "driver of the car was killed and six civilians walking nearby were injured, some of them seriously".
Sheikh Abdiasis Abu Musab, spokesman for al-Shabab's military operations, said: "We targeted the MP and killed him with an assassination bomb ... We managed to place a bomb in his car. Government officials and those who work with them are infidels."
Mohamud was known to be close to President Sheikh Sharif Ahmed. They belonged to the alliance that entered the government in 2009 through a power-sharing deal in Djibouti.
"This has been the first attack of its kind in about a month in Mogadishu which has been pretty safe over the past four weeks," our correspondent said.
"This is a crucial time for the country politically and militarily and this is bad news really because it does seem if it is true that al-Shabab is behind this that they are still able to get into the city to carry out attacks of this kind," she added.
"The explosion was very heavy," said Hassan Muhidin, a witness. "The front part of the car was totally destroyed."
"My sister, who was selling tea near the scene of the explosion, was seriously injured," said Farhiyo Ahmed, another witness. "I saw several other bleeding people who were injured."
The city has seen a series of such attacks since the hardline Shabab abandoned fixed positions there last year and switched to guerrilla tactics against the Western-backed government and a 17,000-strong African Union force.
Al-Shabab face increasing pressure from pro-government forces and regional armies, having lost a series of key towns and strategic bases in recent months.
However, experts warn they are far from defeated and remain a major threat.