"Five people were killed in the attack, among them three security guards," police official Mohamed Adan said.
Sources in the hotel said there were around 70 members of a Turkish delegation in the hotel at the time of the attack, but none of them was injured by the blast.
"I saw it speeding along the main road and the driver turned into the Hotel SYL gate. There was huge explosion, smoke and shrapnel. Several people were down on the ground, I don't know if they were dead," said Abdul-Kader Munin, an eyewitness.
The area around the hotel was quickly sealed off and police fired shots to keep onlookers away on, witnesses said.
A military spokesman for Somalia's al-Qaeda-affiliated al-Shebab, Sheikh Abdul Aziz Abu Musab, confirmed the Islamists had carried out the attack.
"Our group planned the attack. A car full of explosives hit the Hotel SYL," he told AFP, claiming that six government security officers had died in the raid.
Turkish Prime Minister Ahmet Davutoglu said investigations were under way into whether the suicide bomb was a deliberate attack on Turkish interests.
Speaking in Davos, Davutoglu also confirmed that Erdogan would go ahead with his visit to Somalia, which is planned for Friday.
The attack comes even though Mogadishu has been placed under extra-tight security ahead of Erdogan's visit, particularly the area around the presidential palace.
According to an Anadolu news agency correspondent, the authorities have closed all the main roads in the city and will close the airport to air traffic on Friday.
Somalia has remained in the grip of continuous violence since the outbreak of civil war in 1991.
Al-Shebab militants, who have recently pledged allegiance to the Islamic State in Iraq and Syria (ISIS) militant group, are fighting to topple Somalia's internationally-backed government, and regularly launch attacks against state targets, as well as in neighboring countries that contribute to the African Union (AU) force.
Militants have staged repeated assaults in the heart of the government zone in the capital city of Mogadishu, including on the presidential palace, as well as on the airport, a vast base that houses several foreign embassies as well as the headquarters of the AU force.
The United Nations (UN) and aid workers have warned that large areas of Somalia are struggling with dire hunger and drought, three years after famine killed more than a quarter of a million people.
(AFP, Anadolu, Al-Akhbar)