Somalia's al-Shabab fighters have shot dead a lawmaker in the capital Mogadishu, 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 on Monday.



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



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



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

Uganda, Burundi, Djibout, Kenya and Ethiopia have contributed troops to the African Union's peacekeeping mission called AMISOM.



"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," al-Shabab spokesman Sheikh Abdul Aziz Abu Musab told AFP news agency.



"This [is] the fate of all non believers."



Al-Shabab 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 Horn of Africa nation is due to vote on a new constitution next year ahead of elections in 2016, but al-Shabab remains a major threat and stages regular attacks.