Several were injured after a motor attack targeted the area around Somalia's parliamentary building as the country's newly-elected politicians met for the second time on Monday.
The attack was claimed by the terrorist group Al Shabaab, and aimed to hit parliament which is located in a heavily fortified compound in the capital Mogadishu.
Several civilians were injured but no members of parliament were harmed.
The attack came as MPs were setting dates for ballots to choose speakers for the lower and upper houses, the next stage in a stuttering process to elect the fragile nation's new president.
New members of the Senate and the House of the People were sworn in on Thursday after elections - which were held more than a year behind schedule - were marred by deadly violence and a power struggle between the current president and the prime minister.
The upper house will vote on April 26 to choose a speaker, with the lower house choosing its president the following day, officials said.
As Monday's parliamentary session was being streamed live on television several explosions were heard and MPs were told to stay inside.
“We have no details yet but these explosions were caused by mortar fire, the legislators were safe and unharmed inside the building when the incident occurred,” a security officer told AFP.
“I was in the area when the mortar shells landed outside the building where the parliamentarians were meeting, several people were wounded lightly in one of the blasts,” witness Abdukadir Ali said.
Al Shabaab, the Al Qaeda-linked terrorist group that has been waging an insurgency against the central government for more than a decade, claimed responsibility for the attack in a brief statement.
The UN mission in Somalia, UNSOM, issued a statement condemning the mortar attack, saying it “stands firm with Somalis in their efforts to complete the electoral process and progress on national priorities.”
Some parliamentary seats remain unfilled but sufficient MPs have been sworn in to move the election process forward.
So far, 297 MPs have taken the oath of office, from a possible 329 members for both houses.
Somalia has not held a one-person, one-vote election in 50 years.
Instead, elections have followed a complex indirect model, whereby state legislatures and clan delegates pick MPs for the national parliament, who in turn choose the president.