Al-Shabaab (Shabab) often carries out such suicide attacks in the capital and elsewhere in its bid to topple Somalia's Western- backed government. The group wants to impose its radical rule in the Horn of Africa nation.
"The restaurant and the junction were very busy," Police Major Bilow Nurr told Reuters from Baidoa, which lies about 245 kilometres northwest of Mogadishu.
Police Colonel Abdi Osman said the death toll was 30, with 40 others injured.
A hospital official said many of the bodies it received were charred beyond recognition.
A police officer said a suicide car bomb blew up at the junction while a second blast — possibly a bomb that had been planted or a suicide bomber — struck the restaurant.
"We targeted government officials and forces," al-Shabaab's military operation spokesman Sheikh Abdiasis Abu Musab told Reuters, adding there was a police station nearby.
The blasts follows a car bomb attack in Mogadishu near a park and hotel on Friday that killed 14 people.
12/12