At least six people have died after an al-Shabab suicide bomber blew himself up in a restaurant just outside a senior official's office in the central Somali city of Beledweyne.

The deadly blast took place outside the office of the governor of the Hiran region, where he was holding a meeting, police and residents said on Sunday.

"At least six people died, and several others were wounded. A suicide bomber blew up himself in a restaurant," Major Hussein Osman, a police officer, told Reuters news agency from Beledweyne.

The al-Qaeda-linked al-Shabab group said it was behind the attack.

"We are behind the attack at the Hiran governor's headquarters. There are casualties. We targeted the workers of the Hiran administration," said Abdiasis Abu Musab, an al-Shabab spokesman.

READ MORE: Al-Shabab attacks Somalia army base

The town is about 340km north of the capital, Mogadishu. Residents said clan elders were among the dead.

"The suicide bomber who had an explosive jacket stood inside the restaurant and blew up himself. We were heading to a meeting in the governor's office when it happened," said Farah Ali, a local elder.

Somalia has been at war since 1991 when clan-based warlords overthrew longtime leader Siad Barre and then turned on each other.

Al-Shabab has in the past carried out frequent attacks in Mogadishu and other parts of Somalia in a bid to topple the country's Western-backed government and drive out African Union troops.

The armed group also wants to impose its strict interpretation of Islam in Somalia.