The car was driven by a suicide bomber, said Ahmed Abdulle Afrax, the mayor of Wadajir district where the bombing happened.
"We carried 39 dead bodies and there were many others injured," Dr Abdikadir Abdirahman, director of the Aamin Ambulance Service, told Reuters.
Madina hospital took in 47 injured people, Dr Mohamed Yusuf, the manager, said. Witness Abdulle Omar said the market was destroyed.
"I was staying in my shop when a car came in into the market and exploded. I saw more than 20 people lying on the ground. Most of them were dead," Mr Abdulle Omar added.
Al Shabaab has been able to carry out increasingly deadly bombings despite losing most of its territory in the country to African Union peacekeepers supporting Somali government.
This month, Somalia elected a new president, Mohamed Abdullahi Mohamed. The dual US-Somali citizen and former prime minister is better known by his nickname, "Farmajo".
The explosion is the first big attack in the Somali capital since the election of new President Mohamed Abdullahi Mohamed although several mortar blasts claimed by Al-Shabaab terrorists marred the official handover of power last week.
Witnesses said the bombing targeted an intersection in southern Mogadishu's Madina district where soldiers, civilians and traders were present.
"There were many small-scale traders alongside the road and teashops and restaurants. There were also members of the security forces and shoppers. Most of those killed are civilians," said Sumayo Moalim, a witness.
The latest attack underlines the challenge facing the new president, who has inherited an administration with limited control over Somali territory due to the presence of Shabaab, and is heavily propped up by the international community.
(With inputs from Reuters and AFP)
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.