The attack, claimed by Al Shabab militant group, occurred outside the administrative office in the town of Marka, police said.
At least 20 people were killed and several wounded in separate bomb attacks in southern Somalia, police said.
A police officer in the town of Marka in the Lower Shabelle region told Anadolu Agency on Wednesday that a suicide bomber killed 13 people, including the town’s mayor, Abdullahi Ali Wafow, as well as security guards and civilians.
Several others who were wounded were taken to hospitals for treatment.
Marka, 90 kilometers (55 miles) from the Somali capital Mogadishu, is a major town that houses several African Union peacekeeping mission contingents. The attack took place near the Marka administration headquarters.
Abdiaziz Laftagareen, president of the Southwest State, condemned the suicide bombing and the killing of the mayor, calling him "one of the best civil servants" in the country.
The Al Shabab terrorist group claimed responsibility for the attack.
In the same region, a landmine explosion rocked a busy livestock market in the town of Afgoye, killing at least seven people and wounding more than 14 others, according to regional security officials in Lower Shabelle.
The attack in Afgoye also devastated nearby buildings and shops, according to Mohamed Hassan, an eyewitness who spoke to Anadolu Agency by phone.
Afgoye is located 30 kilometers (18 miles) southwest of Mogadishu.
Somalia's new President Hassan Sheikh Mohamud said this month that ending Al Shabab's insurgency required more than a military approach, but that his government would negotiate with the group only when the time is right.
The militants have been seeking to overthrow the fragile foreign-backed government in Mogadishu for about 15 years.
Its fighters were driven out of the capital in 2011 by an African Union force but the group still controls swathes of countryside and has the capacity to wage deadly strikes on civilian and military targets.
Last week, Al Shabab launched a rare incursion into neighbouring Ethiopia, with regional authorities there saying they had killed about 100 militants.
Türkiye strongly condemned the deadly terrorist attacks in Somalia.
“We are deeply saddened to learn that many people, including officials and civilians, lost their lives or were injured in the terrorist attacks that took place today” in Afgoye and Marka, the Turkish Foreign Ministry said in a statement.