The Al-Qaeda-affiliated Shebab rebels are fighting to overthrow the country's government.

AFP/ Mogadishu

Somalia's Shebab insurgents shot dead a lawmaker in the capital Mogadishu on Monday, the latest in a string of assassinations of politicians in the war-torn country.

"Abdulahi Qayad Barre was shot dead, men killed him as he left his house to go to parliament," fellow MP Abdukarim Hajji said.

At least five MPs were killed last year, but Barre was the first to have been assassinated in 2015.

The Al-Qaeda-affiliated Shebab rebels are fighting to overthrow the country's internationally-backed government.

The extremists say they are targeting MPs as they allowed the deployment of foreign troops on Somali soil.

"Shebab commandoes shot and killed Barre, and all the so-called MPs are a legitimate target subject to be killed or captured, to face the justice of Allah," Shebab spokesman Sheikh Abdul Aziz Abu Musab told AFP.

"This the fate of all non-believers."

Shebab attacks in Somalia have targeted key government and security sites in an apparent bid to discredit claims by the authorities and African Union troops that they are winning the war.

Somalia's parliament is also riven by political infighting, prompting repeated warnings by international donors that the power struggles were stalling progress.

The attack came amid tight security as lawmakers gathered to vote on whether to approve a new cabinet, after parliament rejected the new prime minister's last list of candidates.

Omar Abdirashid Ali Sharmarke was named prime minister in December.

The east African country is due to vote on a new constitution next year ahead of elections in 2016, but Shebab fighters remain a major threat and stage regular attacks.