Somali militants have claimed responsibility for killing a second member of parliament in as many days.
Al-Shabab said it shot Abdiaziz Isaq Mursal, who died Tuesday after an ambush in the Dharkaynley district of Mogadishu.
Authorities said he was shot multiple times and died on the spot.
On Monday, the al-Qaida-linked group took credit for a car bombing in Mogadishu that killed parliamentarian Isak Mohamed Ibrahim and wounded another lawmaker.
The U.N. Special Representative for Somalia, Ambassador Nicholas Kay, said the attacks are a reminder that while the Islamist group has lost territory over the past few years, it remains a threat in the country.
"A reminder from them that they are still capable. They are still there. A reminder from them that they are determined to undermine the government and create the impression that the government has not got control. And, I I think this will continue."
Ambassador Kay commented on Tuesday at the Washington-based U.S. Institute of Peace.
African Union and Somali troops have driven al-Shabab out of most major Somali cities and towns, but the militants continue to carry out attacks.
Somali Prime Minister Abdiweli Sheikh Ahmed says in a statement that the use of terror will not stop the government's progress in securing Somalia.