Mogadishu: Islamist rebels said they shot dead a Somali lawmaker in Mogadishu on Saturday and threatened to kill every legislator in the country.

Gunmen shot dead Mustafa Haji Mohammad outside his home after evening prayers, the latest in a wave of attacks since Somalia’s new assembly elected President Hassan Al Shaikh Mahmoud earlier this month.

“How many times had we warned Somalis against joining the infidel government?” Shaikh Abdiasis Abu Musab, spokesman for military operations for the Islamist militant group Al Shabab, told Reuters late on Saturday.

“Let it be a good lesson for the rest.”

Mahmoud’s election was hailed by his supporters and Western powers as a vote for change after more than two decades of violence. The militants were swift to brand the political newcomer a “traitor” who headed a government serving only Western interests.

Mahmoud was the target of a failed suicide bombing just two days into his new job.

“We killed legislator Mustafa ... and we will kill all Somali MPs and officials one by one,” Abu Musab said.

The UN secretary-general’s special envoy to Somalia, Augustine Mahiga, called the shooting a cowardly act that was a “reminder of the challenges faced by the new institutions and administration”.

The appointment of a new, slimmed-down parliament and the first presidential vote came as African troops prepared an assault on Al Shabab’s last stronghold in the south of the country.

Al Shabab drafted in hundreds of fighters from other regions last week to reinforce the port city of Kismayu.

The African Union AMISOM force said, however, there were signs of deepening internal rifts within Al Shabab. More than 200 rebels defected near the town of Jowhar, about 80km from the capital, on Saturday, AMISOM said.

“Al Shabab is divided and being defeated across Somalia,” Brigadier Michael Odonga, the force’s deputy commander, said.

There was no immediate reaction from Al Shabab.

While the loss of Kismayu and its port would weaken the rebels’ morale and deprive them of a key revenue source, it would unlikely deliver a knockout blow to the insurgency.

Although AMISOM and Somali government forces have regained control of numerous towns across southern and central Somalia, the vast rural areas between remain a free-for-all.

Diplomats expect Al Shabab to retreat to the hinterlands, as they have done before, and resort increasingly to the suicide bombings and targeted assassinations that have marked Mahmoud’s first two weeks in power.